Next: , Previous: , Up: More About Types in Python   [Contents][Index]


5.2.2 Canonicalization

When given a type specifier, Python will often rewrite it into a different (but equivalent) type. This is the mechanism that Python uses for detecting type equivalence. For example, in Python’s canonical representation, these types are equivalent:

(or list (member :end)) ≡ (or cons (member nil :end))

This has two implications for the user: