basictypes.typeunion
index
p:\properties\basictypes\typeunion.py

Object representing functional union of two types
 
(wrt. the basictypes/basicproperty type interfaces)

 
Classes
       
tuple(object)
TypeUnion

 
class TypeUnion(tuple)
    An object providing, as much as possible, the union of two types
 
The TypeUnion is intended to allow specifying
baseTypes which are actually 2 or more sub-
types. The TypeUnion is responsible for
mediating between the sub-types (for instance
making sure that items which are instances of
one type are not arbitrarily converted to
instances of another).
 
 
Method resolution order:
TypeUnion
tuple
object

Methods defined here:
__repr__(self)
bestMatch(self, value)
Find the closest item to value's type
 
Defaults to the first item
check(self, value)
Is the value acceptable as one of our types
coerce(self, value)
Coerce the value to one of our types
factories(self)
Get the default set of factory objects

Class methods defined here:
createName(cls, base) from type
Try to create a type-name from base (tuple of sub-types)

Static methods defined here:
__new__(cls, *arguments, **named)
Create a new TypeUnion object
 
A class-name will be calculated by cls.createName

Data and other attributes defined here:
__dict__ = <dictproxy object at 0x01CCC7D0>
dictionary for instance variables (if defined)

Methods inherited from tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getnewargs__(...)
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x

 
Data
        __file__ = r'p:\properties\basictypes\typeunion.pyc'
__name__ = 'basictypes.typeunion'