On Thu, Jun 13, 2013 at 10:18 AM, Skip Montanaro <s...@pobox.com> wrote:
> 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...

Same thing works but with a different name:

from builtins import int as _int

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

Reply via email to