[Python-de] Re: importlib.metadata: Keys funktionieren n icht, wenn es mehrere gibt

Hartmut Goebel <[email protected]> Mon, 2 Jan 2023 16:46:30 +0100
Newsgroups gmane.comp.python.general.german
Organization Goebel Consult
Message-ID <[email protected]>
Am 02.01.23 um 15:00 schrieb [email protected]:
> 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/ 

_______________________________________________
python-de Mailingliste -- [email protected]
Zur Abmeldung von dieser Mailingliste senden Sie eine Nachricht an [email protected]
https://mail.python.org/mailman3/lists/python-de.python.org/
Mitgliedsadresse: [email protected]