Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #5952
| From | Hartmut Goebel <h.goebel@goebel-consult.de> |
|---|---|
| Newsgroups | de.comp.lang.python |
| Subject | [Python-de] Re: importlib.metadata: Keys funktionieren nicht, wenn es mehrere gibt |
| Date | 2023-01-02 16:46 +0100 |
| Organization | Goebel Consult |
| Message-ID | <7c3064a4-bb73-69cc-7a61-3cd13a42aa15@goebel-consult.de> (permalink) |
| References | <4NlyFW1b1Fz6tmg@submission01.posteo.de> |
Am 02.01.23 um 15:00 schrieb c.buhtz@posteo.jp:
> Das funktioniert aber nicht, wenn man z.B. mehrere "Classifier" oder
> "Project-URL" in den Meta-Daten des Paketes hat.
>
> importlib.metadata.metadata['mypackage']['Project-URL']
Muss das nicht sein
a) eine Funktionsaufruf: importlib.metadata.metadata('mypackage')
b) get_all('Project-Url')
denn die Doku [1] sagt:
Note: The actual type of the object returned by |metadata()| is an
implementation detail and *should be accessed only through the
interface described by the **PackageMetadata protocol
<https://importlib-metadata.readthedocs.io/en/latest/api.html#importlib_metadata.PackageMetadata>**.*
[1]
https://docs.python.org/3/library/importlib.metadata.html#distribution-metadata*
*
--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software
Development
Goebel Consult, Landshut
http://www.goebel-consult.de
Blog: https://test.goe-con.de/blog/2019/finger-weg-von-link-verkuerzern/
Kolumne:
https://test.goe-con.de/blog/cissp-gefluester/2012-04-compliance-bringt-keine-sicherheit/
Back to de.comp.lang.python | Previous | Next — Next in thread | Find similar
[Python-de] Re: importlib.metadata: Keys funktionieren nicht, wenn es mehrere gibt Hartmut Goebel <h.goebel@goebel-consult.de> - 2023-01-02 16:46 +0100
[Python-de] Re: importlib.metadata: Keys funktionieren nicht, wenn es mehrere gibt c.buhtz@posteo.jp - 2023-01-02 21:21 +0000
[Python-de] Re: importlib.metadata: Keys funktionieren nicht, wenn es mehrere gibt Hartmut Goebel <h.goebel@goebel-consult.de> - 2023-01-03 20:07 +0100
csiph-web