Skip to main content

Dotted Name Resolution

The zope.dottedname module provides one function, resolve that resolves strings containing dotted names into the appropriate python object.

Dotted names are resolved by importing modules and by getting attributes from imported modules. Names may be relative, provided the module they are relative to is supplied.

Here are some examples of importing absolute names:

>>> from zope.dottedname.resolve import resolve
>>> resolve('unittest')
<module 'unittest' from '...'>
>>> resolve('datetime.datetime')
<type 'datetime.datetime'>
>>> resolve('datetime.datetime.now')
<built-in method now of type object at ...>
>>> resolve('non existent module')
Traceback (most recent call last):
...
ImportError: No module named non existent module
>>> resolve('__doc__')
Traceback (most recent call last):
...
ImportError: No module named __doc__
>>> resolve('datetime.foo')
Traceback (most recent call last):
...
ImportError: No module named foo
>>> resolve('os.path.split').__name__
'split'

Here are some examples of importing relative names:

>>> resolve('.split', 'os.path')
<function split at ...>
>>> resolve('..system', 'os.path')
<built-in function system>
>>> resolve('...datetime', 'os.path')
<module 'datetime' (built-in)>

NB: When relative names are imported, a module the name is relative to must be supplied:

>>> resolve('.split').__name__
Traceback (most recent call last):
...
ValueError: relative name without base module

CHANGES

3.4.3 (2008-12-02)

  • More documentation and tests.

3.4.2 (2007-10-02)

  • Fix broken release.

3.4.1 (2007-10-02)

  • Updated package meta-data.

3.4.0 (2007-07-19)

  • Initial Zope-independent release.

Metadata

Release files for zope.dottedname 3.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zope.dottedname 3.4.3
File Size Uploaded Provenance Actions
zope.dottedname-3.4.3.tar.gz 4.0 kB Without provenance Details for zope.dottedname-3.4.3.tar.gz

Release files / zope.dottedname-3.4.3.tar.gz

Download URL zope.dottedname-3.4.3.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
672a72dd841d9f2d09dfccc6321c68fb8405b7729a1bce9335809efe119c4e44
BLAKE2b-256 checksum
How to use checksums
20f117e8174bee8f42828371fd74572c43b3a1de319c354877c1c685d66dbfc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for zope.dottedname 3.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page