Package bap :: Module adt :: Class ADT
[hide private]
[frames] | no frames]

Class ADT

source code

object --+
         |
        ADT
Known Subclasses:

Algebraic Data Type.

This is a base class for all ADTs. ADT represented by a tuple of arguments, stored in a `arg` field. Arguments should be instances of ADT class, numbers, strings or lists. Empty set of arguments is permitted. A one-tuple is automatically untupled, i.e., `Int(12)` has value `12`, not `(12,)`. A name of the constructor is stored in the `constr` field

A structural comparison is provided.

Instance Methods [hide private]
 
__init__(self, *args)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__cmp__(self, other) source code
 
__repr__(self)
repr(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)