Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Bug report
Bug description:
The Python 3.12 documentation of the standard library moduleimportlib.resources describes theimportlib.resources.Anchor class, which is used for the type annotation of thefiles() function.
But in realityAnchor is not available to import fromimportlib.resources, it can only by found inimportlib.resources._common as an alias forPackage (which is instead available fromimportlib.resources).
To reproduce:
>>>fromimportlib.resourcesimportAnchorTraceback (mostrecentcalllast):File"<stdin>",line1,in<module>ImportError:cannotimportname'Anchor'from'importlib.resources' (/usr/lib/python3.12/importlib/resources/__init__.py)
Expected result:
NoImportError
Use case:
To add type annotation to a function that receives an anchor and passes it tofiles().
CPython versions tested on:
3.12
Operating systems tested on:
Linux