>>> int="five"
>>> [int(i) for i in ["1","2","3"]]
TypeError:  str is not callable

> Now how are you going to get the original int type back?

Magic. :-)

>>> int = "five"
>>> int("a")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable
>>> from __builtin__ import int as _int
>>> _int("5")
5

Not sure of the magic necessary in Python 3.  This is definitely
something you don't want to make a habit of...

S
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to