In Python there are basic types like unicode, integer or float. And there are more complex types like dates.
The module itools.datatypes provides an infrastructure orthogonal to the Python types. The basic service provided by this infrastructure is the deserialization and serialization of values; which is implemented as the couple of class methods decode and encode, for example:
>>> from itools.datatypes import DateTime
>>> datetime = DateTime.decode('2005-05-02T16:47')
>>> datetime
datetime.datetime(2005, 5, 2, 16, 47)
>>> DateTime.encode(datetime)
'2005-05-02T16:47:00'
This approach, to implement the serialization/deserialization code separate from the type itself, allows to avoid sub-classing built-in types, what has a performance impact.
This also illustrates one of the software principles behind the itools coding, different programming aspects should be clearly distinct in the implementation and programming interface.