UserManual

compatibility

Keep compatibility between Python versions.

This module should be simply imported:

 import nzmath.compatibility

then it does its tasks.

set, frozenset

Currently, it provides set for Python 2.3. Python >=2.4 have set in built-in namespace, while Python 2.3 has sets module and sets.Set. The set the module provides for Python 2.3 is the sets.Set. Similarly, sets.ImmutableSet would be assigned to frozenset. Be careful that the compatibility is not perfect.

card(virtualset)

Return cardinality of the virtualset.

The builtin len() raises OverflowError when the result > sys.maxint. It is not clear this restriction will go away in the future. The function card() ought to be used instead of len() for obtaining cardinality of sets or set-like objects in nzmath.