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 pytyp

How to install pytyp

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install pytyp
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2.0.1 Available View build log
2.0 Available View build log
1.1 Failed View build log
1.0.2 Failed View build log
2.0.1 Available View build log
2.0 Available View build log
1.1 Available View build log
1.0.2 Available View build log
Windows (64-bit)
2.0.1 Available View build log
2.0 Available View build log
1.1 Failed View build log
1.0.2 Failed View build log
2.0.1 Available View build log
2.0 Available View build log
1.1 Available View build log
1.0.2 Available View build log
Mac OS X (10.5+)
2.0.1 Available View build log
2.0 Available View build log
1.1 Failed View build log
1.0.2 Failed View build log
2.0.1 Available View build log
2.0 Available View build log
1.1 Failed View build log
1.0.2 Failed View build log
Linux (32-bit)
2.0.1 Available View build log
2.0 Available View build log
1.1 Failed View build log
1.0.2 Failed View build log
2.0.1 Available View build log
2.0 Available View build log
1.1 Failed View build log
1.0.2 Failed View build log
Linux (64-bit)
2.0.1 Available View build log
2.0 Available View build log
1.1 Failed View build log
1.0.2 Failed View build log
2.0.1 Available View build log
2.0 Available View build log
1.1 Failed View build log
1.0.2 Failed View build log
2.0.1 Available View build log
 
Author
Lastest release
version 2.0.1 on Jun 2nd, 2011

Pytyp uses ABCs and function annotations in a consistent, pythonic way that supports declarative APIs - instead of saying how to do something, you have the ability to say what you want.

It includes:

  • A basic set of type specifications for describing collections of data, closely integrated into the language:

    >>> isinstance([1,2,None,4], Seq(Opt(int)))
    True
    
  • A decorator that type-checks functions:

    >>> def str_only(x:str): return 'foo'
    >>> str_only(42)
    Exception raised:
      ...
    TypeError: Type str inconsistent with 42.
    
  • A decorator that allows dynamic dispatch by type. You can combine multiple methods under one name, and then select which method is called by the type of an argument (normal OO programming uses the type of self to select the method; this is more like Lisp's multimethods).

  • Routines for converting between Python classes and JSON or YAML. Instead of having to work with dict and list you can read JSON directly into Python classes. This is included as an example of the kind of API possible - you describe the form of the output using type specifications.

The ideas behind the library are described in more detail in Algebraic ABCs.

Subscribe to package updates

Last updated Jun 2nd, 2011

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.