Lazy coerce function?

Treutwein Guido Guido.Treutwein at nbg.siemens.de
Mon Sep 25 10:35:46 EDT 2000


The documentation is a little bit on the short side, specifying, that
numbers are casted to compatible types.

Python 1.6 reacts as follows:
coerce(3,'a') # raises a TypeError, as expected.
coerce('a', 'b') # returns ('a', 'b')
coerce('a', []) # raises TypeError

Is there any simple rule under what circumstances coerce raises an
exception?






More information about the Python-list mailing list