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: 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 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: In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On 11/04/2012 11:27 PM, Chris Angelico wrote: > On Mon, Nov 5, 2012 at 6:07 PM, Chris Rebert wrote: >>>>> x = None >>>>> x.a = 42 >> Traceback (most recent call last): >> File "", line 1, in >> 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...