Metadata-Version: 1.0
Name: integer
Version: 1.0.2
Summary: Package for creating integer types.

Home-page: https://code.google.com/p/python-integer
Author: Garrett Beaty
Author-email: garrett.beaty@gmail.com
License: UNKNOWN
Description: 
        This package provides utilities for creating custom integer types.
        
        Integer
        -------
        
        Inheriting directly from ``int`` type results in custom integer types where the results of operations are instances of int type. ::
        
            >>> class X(int): pass
            ...
            >>> a = X(1)
            >>> x = a + 1
            >>> x
            2
            >>> x.__class__
            <type 'int'>
        
        ``Integer`` can be used as a base class for custom integer types that preserve the type when performing operations. ::
        
            >>> from integer import Integer
            >>> class X(Integer): pass
            ...
            >>> a = X(1)
            >>> x = a + 1
            >>> x
            2
            >>> x.__class__
            <class '__main__.X'>
        
        Subclasses can override the ``finalize_values`` method in order to affect the final return value of oeprations whenever the ``int`` operations returns an ``int``.
        
        enum
        ----
        
        ``enum`` can be used to declare an enumeration, which defines the enumeration type and its enumeration values in the global scope of the calling module. ::
        
            >>> from integer.enum import enum
            >>> enum('RGB', RED=1, GREEN=2, BLUE=3, ALPHA=4)
            >>> RGB
            <class 'integer.enum.RGB'>
            >>> RED
            RED
            >>> int(RED)
            1
            >>> RGB(1)
            RED
            >>> RGB(1) is RED
            True
            >>> RED, GREEN, BLUE, ALPHA, RGB(5)
            (RED, GREEN, BLUE, ALPHA, RGB(5))
        
        The type defined by ``enum`` does not restrict the values that it can represent, it just provides a helpful string representation for the named values.
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.1
Classifier: Programming Language :: Python :: 3.2
