Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install zope.dottedname

How to install zope.dottedname

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install zope.dottedname
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
4.0.1 Available View build log
3.4.6 Available View build log
Windows (64-bit)
4.0.1 Available View build log
3.4.6 Available View build log
Mac OS X (10.5+)
4.0.1 Available View build log
3.4.6 Available View build log
Linux (32-bit)
4.0.1 Available View build log
3.4.6 Available View build log
Linux (64-bit)
4.0.1 Available View build log
3.4.6 Available View build log
4.0.1 Available View build log
 
License
ZPL 2.1
Dependencies
Imports
Lastest release
version 4.0.1 on Mar 13th, 2013

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

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

4.0.1 (2013-03-12)
  • Added Trove classifier claiming PyPy support.
4.0.0 (2013-02-05)
  • Made tests pass on Python 3.2, 3.3 and PyPy.
  • Added support for continuous integration using tox.
3.4.6 (2009-09-15)
  • Make tests pass on python26.
3.4.5 (2009-01-27)
  • Move README.txt in the egg, so tests works with the released egg as well.
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.

Subscribe to package updates

Last updated Mar 13th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.