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


Groups > comp.lang.python > #47864

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

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'python3': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; '3)]': 0.16; 'builtins.': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'syntaxerror:': 0.16; 'then?': 0.16; 'sender:addr:gmail.com': 0.17; 'bit': 0.19; 'feb': 0.22; '>>>': 0.22; 'cc:addr:gmail.com': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**1': 0.23; 'skip': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; "i'm": 0.30; '"",': 0.31; 'file': 0.32; 'received:google.com': 0.35; 'keyword': 0.36; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'invalid': 0.68; '4.2.1': 0.84; '2013,': 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=ojWMM8V55+ooJ5GRAvyAOk+L2HLEa1cLJjtifZMM1xg=; b=H9I2nj+VPkUfyayD3s2VsM8Apz+i4HaKH/x02Wo3XdzYX493LcEE0YQZLbZDXS6B6r eViYReef0fLoM1ZTd475zWVf0HJDRL0byTCSpAJV3i3/Vusd7cx1YSWwNs8ARWQnkMQx GGvTanQcyeaGS9EIqXmev3BjgCc8RXDJUbIKyOyx7OB1PKwe4wsJUiagcVsxn/+dzB5x 1WVVBye3Mc8A+rn2r1QcjwaPWno9APmD6MwGcBVuW1JwrKR8EFw+eND1ljiOic4fVi60 e1psUg2v1iEVhNCJZKTDOzhcLDD2mXmaohxEwu53CG8wo9WWg8EUYT1DWmG3pE26mN7z 9PLA==
MIME-Version 1.0
X-Received by 10.50.67.110 with SMTP id m14mr4395308igt.37.1371081968966; Wed, 12 Jun 2013 17:06:08 -0700 (PDT)
Sender skip.montanaro@gmail.com
In-Reply-To <CAMjeLr9Qm5uA8AA5G3rm+ikN+f3JoVjS_j9_nhuU7m3s+WbydQ@mail.gmail.com>
References <kp5q5o$fj1$1@ger.gmane.org> <mailman.3096.1371040064.3114.python-list@python.org> <kpa0ae$b4t$1@reader1.panix.com> <CAMjeLr_ozpfk3TxaEOaenoES5jUpYnZDaYWcNbX1FctO8OLuDw@mail.gmail.com> <CAPTjJmrwx6BV=Crm9bYeayRH83OGJ48w_fy_MpB-_wHpgfimpA@mail.gmail.com> <CAMjeLr9Qm5uA8AA5G3rm+ikN+f3JoVjS_j9_nhuU7m3s+WbydQ@mail.gmail.com>
Date Wed, 12 Jun 2013 19:06:08 -0500
X-Google-Sender-Auth Ww8pI0PTSUWQYlhYSA8FnjS27pY
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
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.3144.1371081976.3114.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1371081976 news.xs4all.nl 15914 [2001:888:2000:d::a6]:55502
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:47864

Show key headers only | View raw


> Okay, now I'm a bit confused.  "print" is both a <keyword> and a
> member of the builtins.  What happens then?

It's a keyword in Python < 3, a built-in function in Python >= 3:

~% python3
Python 3.4.0a0 (default:96f08a22f562, Feb 24 2013, 23:37:53)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print
<built-in function print>
>>> x = print
>>>
~% python2
Python 2.7.5+ (2.7:4657d0eebe42, Jun  2 2013, 07:46:59)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print

>>> x = print
  File "<stdin>", line 1
    x = print
            ^
SyntaxError: invalid syntax


Skip

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


Thread

Re: "Don't rebind built-in names*" - it confuses readers Mark Janssen <dreamingforward@gmail.com> - 2013-06-10 17:18 -0700
  Re: "Don't rebind built-in names*" - it confuses readers Grant Edwards <invalid@invalid.invalid> - 2013-06-12 14:24 +0000
    Re: "Don't rebind built-in names*" - it confuses readers Mark Janssen <dreamingforward@gmail.com> - 2013-06-12 12:40 -0700
    Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 06:30 +1000
    Re: "Don't rebind built-in names*" - it confuses readers Mark Janssen <dreamingforward@gmail.com> - 2013-06-12 16:07 -0700
    Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 09:53 +1000
      Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-13 00:47 +0000
    Re: "Don't rebind built-in names*" - it confuses readers Skip Montanaro <skip@pobox.com> - 2013-06-12 19:06 -0500
    Re: "Don't rebind built-in names*" - it confuses readers Mark Janssen <dreamingforward@gmail.com> - 2013-06-12 17:26 -0700
      Re: "Don't rebind built-in names*" - it confuses readers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-13 01:23 +0000
        Re: "Don't rebind built-in names*" - it confuses readers Nobody <nobody@nowhere.com> - 2013-06-13 11:09 +0100
    Re: "Don't rebind built-in names*" - it confuses readers Chris Angelico <rosuav@gmail.com> - 2013-06-13 10:28 +1000

csiph-web