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' from '...'>

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.4 (2009-01-27)

  • Fix ReST in README.txt, fix broken tests with recent zope.testing.

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.4

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.4
File Size Uploaded Provenance Actions
zope.dottedname-3.4.4.tar.gz 4.1 kB Without provenance Details for zope.dottedname-3.4.4.tar.gz

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

Download URL zope.dottedname-3.4.4.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f891189271681f7d2ac4ce659a12f2a0be501516ef734c0476b903af18364b41
BLAKE2b-256 checksum
How to use checksums
81c32f6b3f2eb259786c871473882d5af3c7b5e6ff1728bb7ca449081809ed90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for zope.dottedname 3.4.4

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