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


Groups > comp.lang.python > #32759

Re: Multi-dimensional list initialization

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!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <andrew3@r3dsolutions.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.061
X-Spam-Evidence '*H*': 0.88; '*S*': 0.00; 'attribute': 0.05; 'linux,': 0.05; "'a'": 0.07; 'attributes': 0.07; 'python': 0.09; 'eagain,': 0.16; 'sure.': 0.16; 'utterly': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'error.': 0.21; '"",': 0.22; 'object.': 0.22; 'subject:skip:i 10': 0.22; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; '(most': 0.27; "doesn't": 0.28; 'subject:list': 0.28; 'chris': 0.28; 'this.': 0.29; 'error': 0.30; 'file': 0.32; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'nov': 0.35; 'pm,': 0.35; 'something': 0.35; 'useful': 0.36; 'subject:: ': 0.38; 'comment': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'where': 0.40; 'subject:-': 0.40; 'end': 0.40; 'received:network': 0.61; 'received:phx3.secureserver.net': 0.62; 'received:prod.phx3.secureserver.net': 0.62; 'skip:y 20': 0.62; 'strange': 0.62; 'wall': 0.62; 'received:unknown': 0.63; 'times': 0.63; 'header:Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'dreamed': 0.91; 'received:173.201': 0.91; 'received:173.201.192': 0.91; 'insane': 0.93
Date Sun, 04 Nov 2012 23:54:49 -0800
From Andrew Robinson <andrew3@r3dsolutions.com>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111126 Thunderbird/8.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Multi-dimensional list initialization
References <A399B195-7ED3-42D6-A54F-299FE66EBFAE@gmail.com> <CAMZYqRRA=i=_A_eLY4pFZgh5RbZKKhY8=5pJPE=pYgsW2XjP7A@mail.gmail.com> <CAPTjJmoWMQR-PfO4rGJdF=SYdExJCA=Q+C_AaRJN5ciEDHYW3g@mail.gmail.com>
In-Reply-To <CAPTjJmoWMQR-PfO4rGJdF=SYdExJCA=Q+C_AaRJN5ciEDHYW3g@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To andrew3@r3dsolutions.com
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.3276.1352102057.27098.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1352102057 news.xs4all.nl 6909 [2001:888:2000:d::a6]:33348
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:32759

Show key headers only | View raw


On 11/04/2012 11:27 PM, Chris Angelico wrote:
> On Mon, Nov 5, 2012 at 6:07 PM, Chris Rebert<clp2@rebertia.com>  wrote:
>>>>> x = None
>>>>> x.a = 42
>> Traceback (most recent call last):
>>    File "<stdin>", line 1, in<module>
>> AttributeError: 'NoneType' object has no attribute 'a'
> Python needs a YouGottaBeKiddingMeError for times when you do
> something utterly insane like this. Attributes of None??!? :)
>
> ChrisA
Hmmm? Everything in Python is an object.
Therefore! SURE. None *does* have attributes! ( even if not useful ones... )

eg: " None.__getattribute__( "__doc__" ) " doesn't produce an error.

In C, in Linux, at the end of the file "errno.h", where all error codes 
are listed eg:( EIO, EAGAIN, EBUSY, E....) They had a final error like 
the one you dreamed up, it was called "EIEIO"; and the comment read 
something like, "All the way around Elmer's barn".

:)

The poster just hit that strange wall -- *all* built in types are 
injection proof; and that property is both good and bad...

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


Thread

Re: Multi-dimensional list initialization Andrew Robinson <andrew3@r3dsolutions.com> - 2012-11-04 23:54 -0800

csiph-web