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 dolmen.builtins

How to install dolmen.builtins

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install dolmen.builtins
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.3.1 Available View build log
Windows (64-bit)
0.3.1 Available View build log
Mac OS X (10.5+)
0.3.1 Available View build log
Linux (32-bit)
0.3.1 Available View build log
Linux (64-bit)
0.3.1 Available View build log
 
License
GPL
Dependencies
Depended by
Imports
Lastest release
version 0.3.1 on Jan 5th, 2011

dolmen.builtins provides a collection of interfaces representing the commonly used Python built-ins. It aims to make the component architecture useable with the most basic objects and to defines the types in order to extend them conveniently.

>>> from zope.interface import verify
>>> from dolmen.builtins import interfaces as base
>>> macduff = "Tis' a very nice string."
>>> base.IString.providedBy(macduff)
True
>>> macbeth = u"Aye, indeed my friend."
>>> base.IUnicode.providedBy(macbeth)
True
>>> is_usurper = True
>>> base.IBoolean.providedBy(is_usurper)
True
>>> crown = 1
>>> base.INumeric.providedBy(crown)
True
>>> king = 0.1
>>> base.INumeric.providedBy(king)
True
>>> opposants = 1L
>>> base.INumeric.providedBy(opposants)
True

More complex types have more information defined in their interfaces. It's the case for iterables and file-like classes.

>>> murderers = ('MacBeth', 'Lady MacBeth')
>>> base.ITuple.providedBy(murderers)
True
>>> victims = ['Banco', 'Duncan']
>>> base.IList.providedBy(victims)
True
>>> thanes = {"Glamis": "MacBeth", "Fife": "MacDuff"}
>>> base.IDict.providedBy(thanes)
True
>>> base.IIterable.providedBy(victims)
True
>>> base.IIterable.providedBy(murderers)
True
>>> base.IIterable.providedBy(thanes)
True
>>> verify.verifyObject(base.IDict, thanes)
True
>>> base.IFile.implementedBy(file)
True
>>> verify.verifyClass(base.IFile, file)
True

Changelog

0.3.1 (2010-02-27)
  • Remove zope.testing dependency.
0.3 (2010-02-27)
  • Cleaned code. It's now pep8 compliant.
  • Cleaned dependencies. We no longer depend on zope.app.
0.2 (2009-10-16)
  • Added file to the marked built-ins, using a detailed interface.
0.1 (2009-10-15)
  • Initial release

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:2

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.