Package lxml :: Module objectify :: Class PyType
[show private | hide private]
[frames | no frames]

Type PyType

object --+
         |
        PyType


User defined type.

Named type that contains a type check function and a type class that
inherits from ObjectifiedDataElement.  The type check must take a string
as argument and raise ValueError or TypeError if it cannot handle the
string value.  It may be None in which case it is not considered for type
guessing.

Example:
    PyType('int', int, MyIntClass).register()

Note that the order in which types are registered matters.  The first
matching type will be used.

Method Summary
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __repr__(x)
x.__repr__() <==> repr(x)
  register(...)
Register the type.
  unregister(...)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
member_descriptor name = <member 'name' of 'lxml.objectify.PyType' objects...
member_descriptor type_check = <member 'type_check' of 'lxml.objectify.PyT...
getset_descriptor xmlSchemaTypes = <attribute 'xmlSchemaTypes' of 'lxml.ob...

Method Details

__init__(...)
(Constructor)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides:
__builtin__.object.__init__

__new__(T, S, ...)

T.__new__(S, ...) -> a new object with type S, a subtype of T
Returns:
a new object with type S, a subtype of T
Overrides:
__builtin__.object.__new__

__repr__(x)
(Representation operator)

x.__repr__() <==> repr(x)
Returns:
repr(x)
Overrides:
__builtin__.object.__repr__

register(...)

Register the type.

The additional keyword arguments 'before' and 'after' accept a sequence of type names that must appear before/after the new type in the type list. If any of them is not currently known, it is simply ignored. Raises ValueError if the dependencies cannot be fulfilled.

Class Variable Details

name

Type:
member_descriptor
Value:
<member 'name' of 'lxml.objectify.PyType' objects>                     

type_check

Type:
member_descriptor
Value:
<member 'type_check' of 'lxml.objectify.PyType' objects>               

xmlSchemaTypes

Type:
getset_descriptor
Value:
<attribute 'xmlSchemaTypes' of 'lxml.objectify.PyType' objects>        

Generated by Epydoc 2.1 on Sat Aug 18 12:44:27 2007 http://epydoc.sf.net