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


Groups > comp.lang.python > #6339

RE: Puzzled by list-appending behavior

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ramit.prasad@jpmchase.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; '(at': 0.03; '(python': 0.05; 'completeness': 0.05; 'instance': 0.05; 'python': 0.08; '3.x': 0.09; 'confuse': 0.09; '>>>': 0.12; '(list)': 0.16; '*really*': 0.16; '712': 0.16; 'affiliates,': 0.16; 'confusing.': 0.16; 'currencies': 0.16; 'insist': 0.16; 'opened,': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:169.70': 0.16; 'received:169.70.190': 0.16; 'received:172.18.0': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'solicitation': 0.16; 'subject:behavior': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'tries': 0.16; 'subject:list': 0.19; 'keyword': 0.19; 'header:In-Reply-To:1': 0.21; 'applicable,': 0.23; 'correct,': 0.23; 'herein': 0.23; 'received:169': 0.25; 'received:169.254': 0.25; 'later': 0.26; 'example': 0.27; 'reflect': 0.28; 'bugs': 0.29; 'least': 0.30; 'chase': 0.30; 'received:155': 0.30; 'received:159': 0.30; 'received:169.254.1': 0.30; 'calling': 0.31; 'print': 0.31; 'header:Received:8': 0.32; 'usage': 0.32; '(including': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'list': 0.33; 'things': 0.33; 'showing': 0.34; 'thank': 0.35; 'received:172.18': 0.35; 'phone:': 0.36; '(with': 0.36; 'format.': 0.36; 'accepted': 0.36; 'charset:us-ascii': 0.36; 'change': 0.37; 'accuracy': 0.37; 'arising': 0.37; 'could': 0.38; 'but': 0.38; 'data': 0.38; 'purposes': 0.38; 'subject:: ': 0.38; 'comments': 0.39; 'legally': 0.39; 'list,': 0.39; 'to:addr:python.org': 0.39; 'under': 0.40; 'happen': 0.60; 'to:2**2': 0.61; 'you.': 0.62; 'human': 0.62; 'subject': 0.62; 'market': 0.63; 'virus': 0.63; 'free': 0.63; 'note:': 0.63; 'ever': 0.64; 'applicable': 0.65; 'co.,': 0.65; 'contact': 0.66; 'relating': 0.67; 'legal': 0.70; 'offer': 0.71; 'become': 0.72; 'sale': 0.76; 'bank': 0.76; 'investment': 0.78; 'purchase': 0.83; 'affiliates.': 0.84; 'prices,': 0.84; 'defect': 0.91; 'which.': 0.91; 'instrument': 0.95; 'notice.': 0.96
X-DKIM Sendmail DKIM Filter v2.5.6 sf2.jpmchase.com p4QJYBhQ007057
DKIM-Signature v=1; a=rsa-sha256; c=simple/simple; d=jpmchase.com; s=smtpout; t=1306438451; bh=H3dWsZMM+wE8oHoMjw1tMhJiPwigZWTCmY4NHYf FANg=; h=From:To:Date:Subject:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=aEcPtn2Mpc6 VZjDA0x7L2ya757lDgqgdvwKsgnqujr+3lEnyJM9kBRM7fExf8LmA1yyvbts82xgFmo SVLo+bSNMocQZZ8dcWD+Z54eUGaY0gTxve6dqXXr1MGF3wtfEM/UYDu0zrYUkvQGoNk VCiAy4lMgzuAl4q3kpjUqHOBFg=
From "Prasad, Ramit" <ramit.prasad@jpmchase.com>
To "'Terry Reedy'" <tjreedy@udel.edu>, "'python-list@python.org'" <python-list@python.org>, "'Uncle Ben'" <bgreen@nycap.rr.com>
Date Thu, 26 May 2011 15:34:01 -0400
Subject RE: Puzzled by list-appending behavior
Thread-Topic Puzzled by list-appending behavior
Thread-Index Acwb1ai4VU4+0W9cSa22aPvjt1afiQABaQRg
References <16c21256-48df-416a-971f-de49ca4cc981@x6g2000yqj.googlegroups.com> <201105261718.36646.akabaila@pcug.org.au> <irm735$pp1$1@dough.gmane.org>
In-Reply-To <irm735$pp1$1@dough.gmane.org>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
acceptlanguage en-US
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-DLP-FWD Yes
Content-Type text/plain; charset="us-ascii"
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.2128.1306439781.9059.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 82.94.164.166
X-Trace 1306439782 news.xs4all.nl 49038 [::ffff:82.94.164.166]:57363
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:6339

Show key headers only | View raw


>> And why do you insist on calling an instance of list, "list"? Even a
>> human reader will confuse which is which. What you are showing is an
>> example how confusing things become when a keyword (list) is
>> over-written (with list instance).

> (Minor note: 'list' is not a keyword (if it were, it could not be 
>over-ridden) but it is a builtin.) You are correct, it is confusing. 
>Such usage will also lead to bugs if one ever tries to access the >class 
>as 'list' later in the program.


An example of overriding built-ins you *really* do not want to happen (python 2.6.4): 
>>> True = False
>>> True == False
True
>>> print True
False

From what I can tell, this does not work in Python 3.x (at least not in Python 3.1.1)



Ramit



Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423


This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to European legal entities.

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


Thread

Puzzled by list-appending behavior Uncle Ben <bgreen@nycap.rr.com> - 2011-05-25 21:46 -0700
  Re: Puzzled by list-appending behavior Ben Finney <ben+python@benfinney.id.au> - 2011-05-26 15:11 +1000
  Re: Puzzled by list-appending behavior Chris Rebert <clp2@rebertia.com> - 2011-05-25 22:17 -0700
  Re: Puzzled by list-appending behavior Chris Angelico <rosuav@gmail.com> - 2011-05-26 17:20 +1000
  Re: Puzzled by list-appending behavior Chris Angelico <rosuav@gmail.com> - 2011-05-26 17:23 +1000
  Re: Puzzled by list-appending behavior Uncle Ben <bgreen@nycap.rr.com> - 2011-05-26 00:33 -0700
  Re: Puzzled by list-appending behavior Chris Rebert <clp2@rebertia.com> - 2011-05-26 01:09 -0700
  Re: Puzzled by list-appending behavior MRAB <python@mrabarnett.plus.com> - 2011-05-26 16:58 +0100
    Re: Puzzled by list-appending behavior Tim Roberts <timr@probo.com> - 2011-05-26 23:34 -0700
      Re: Puzzled by list-appending behavior MRAB <python@mrabarnett.plus.com> - 2011-05-27 17:02 +0100
  Re: Puzzled by list-appending behavior Chris Angelico <rosuav@gmail.com> - 2011-05-27 02:04 +1000
  Re: Puzzled by list-appending behavior John Ladasky <ladasky@my-deja.com> - 2011-05-26 11:27 -0700
    Re: Puzzled by list-appending behavior Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-27 01:59 +0000
      Re: Puzzled by list-appending behavior Chris Angelico <rosuav@gmail.com> - 2011-05-27 13:24 +1000
        Re: Puzzled by list-appending behavior Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-27 03:52 +0000
          Re: Puzzled by list-appending behavior Chris Angelico <rosuav@gmail.com> - 2011-05-27 14:10 +1000
          RE: Puzzled by list-appending behavior "Prasad, Ramit" <ramit.prasad@jpmchase.com> - 2011-05-27 13:58 -0400
          Re: Puzzled by list-appending behavior Ethan Furman <ethan@stoneleaf.us> - 2011-05-27 11:56 -0700
  Re: Puzzled by list-appending behavior Terry Reedy <tjreedy@udel.edu> - 2011-05-26 14:44 -0400
  RE: Puzzled by list-appending behavior "Prasad, Ramit" <ramit.prasad@jpmchase.com> - 2011-05-26 15:34 -0400
  Re: Puzzled by list-appending behavior Terry Reedy <tjreedy@udel.edu> - 2011-05-26 17:36 -0400

csiph-web