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: 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: References: <51b69332$0$29997$c3e8da3$5496439d@news.astraweb.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 To: Mark Janssen Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org, Steven D'Aprano X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 >>> 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 "", line 1, in 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