Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #47867

Re: "Don't rebind built-in names*" - it confuses readers

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.023
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'cc:addr:python-list': 0.11; 'python': 0.11; '__builtin__': 0.16; '_int': 0.16; 'callable': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'magic': 0.16; 'typeerror:': 0.16; ':-)': 0.16; 'sender:addr:gmail.com': 0.17; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; '"",': 0.31; 'file': 0.32; '(most': 0.33; 'something': 0.35; 'received:google.com': 0.35; 'skip:[ 10': 0.38; 'recent': 0.39; 'sure': 0.39; 'how': 0.40; 'to:addr:gmail.com': 0.65; 'back?': 0.84; 'habit': 0.91; 'subject:Don': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=aL+0JgurIlLS3JLRhC0o3VyFhjh3hGBkmvzEpDKINlo=; b=VyEHuqNmAlH7T3cW31JLw/dSpDHWIQ7b59s647uuHTlH7hxI5PMnqsI4OaTrUgs4iA 0bwJ4ajO8MTUxYlpge6qwMR9O4lpFmEmXOu0iiuQd0xn/xp6D6cK0wtZXg1r4/J1CG/m 2qKxqZE47Q9MnmL424YHpJZY05JOAk6BmntF+vx0Rq9ozfvnE+oMdsBip3al5W/cYp8V gzbMLItJe5juvHdIBzkFgCikh7tAyZ2zC9voEl3+7PH3ux0sO/7y2F8IBiHOyyQjrXc4 Qx3UNWqMa/S6AUkaVBG15wpWw1ZpQwZ3DxnI9DGKSQChyiNlneMIsgNke1qKMcb3Qd46 TDoA==
MIME-Version 1.0
X-Received by 10.50.40.39 with SMTP id u7mr4589636igk.51.1371082700991; Wed, 12 Jun 2013 17:18:20 -0700 (PDT)
Sender skip.montanaro@gmail.com
In-Reply-To <CAMjeLr9pURVnRmsFFuOt5vxGvDMmmyTzmR49-k5ourng98VsiQ@mail.gmail.com>
References <mailman.3001.1370909708.3114.python-list@python.org> <dffd70ad-4e9a-45cd-914b-7f1388ded5a2@a9g2000pbq.googlegroups.com> <51b69332$0$29997$c3e8da3$5496439d@news.astraweb.com> <CAMjeLr9pURVnRmsFFuOt5vxGvDMmmyTzmR49-k5ourng98VsiQ@mail.gmail.com>
Date Wed, 12 Jun 2013 19:18:20 -0500
X-Google-Sender-Auth OEUxwm8NAAo19PIY-DOHUwsB8W4
Subject Re: "Don't rebind built-in names*" - it confuses readers
From Skip Montanaro <skip@pobox.com>
To Mark Janssen <dreamingforward@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc python-list@python.org, Steven D'Aprano <steve+comp.lang.python@pearwood.info>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3146.1371082709.3114.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1371082709 news.xs4all.nl 15975 [2001:888:2000:d::a6]:39936
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:47867

Show key headers only | View raw


>>> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

"Don't rebind built-in names*" - it confuses readers Terry Jan Reedy <tjreedy@udel.edu> - 2013-06-10 20:14 -0400
  Re: "Don't rebind built-in names*" - it confuses readers rusi <rustompmody@gmail.com> - 2013-06-10 19:36 -0700
    Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 03:02 +0000
      Re: "Don't rebind built-in names*" - it confuses readers rusi <rustompmody@gmail.com> - 2013-06-10 20:30 -0700
        Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 05:52 +0000
        Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-11 17:20 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-11 13:57 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Serhiy Storchaka <storchaka@gmail.com> - 2013-06-11 18:55 +0300
      Re: "Don't rebind built-in names*" - it confuses readers Mark Janssen <dreamingforward@gmail.com> - 2013-06-12 17:04 -0700
        Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-13 01:01 +0000
      Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 10:08 +1000
        Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-13 01:08 +0000
          Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 11:30 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Skip Montanaro <skip@pobox.com> - 2013-06-12 19:18 -0500
      Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 10:33 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Ethan Furman <ethan@stoneleaf.us> - 2013-06-12 17:30 -0700
  Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 02:56 +0000
    Re: "Don't rebind built-in names*" - it confuses readers Terry Jan Reedy <tjreedy@udel.edu> - 2013-06-11 02:06 -0400
    Re: "Don't rebind built-in names*" - it confuses readers Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-11 08:22 -0700
      Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-11 16:59 +0000
      Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-12 03:32 +1000

csiph-web