Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!feed.xsnews.nl!border-3.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed5.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'attribute': 0.05; 'linux,': 0.05; "'a'": 0.07; 'attributes': 0.07; 'python': 0.09; 'attributes,': 0.16; 'eagain,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'said.': 0.16; 'sure.': 0.16; 'utterly': 0.16; 'mon,': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'error.': 0.21; 'meant': 0.21; '"",': 0.22; 'object.': 0.22; 'pipe': 0.22; 'subject:skip:i 10': 0.22; 'header:In-Reply-To:1': 0.25; '(most': 0.27; 'andrew': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'subject:list': 0.28; 'chris': 0.28; 'search.': 0.29; 'this.': 0.29; "i'm": 0.29; 'error': 0.30; 'file': 0.32; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'nov': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.36; 'useful': 0.36; 'bad': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'comment': 0.38; 'object': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'where': 0.40; 'subject:-': 0.40; 'header:Received:5': 0.40; 'end': 0.40; 'skip:y 20': 0.62; 'times': 0.63; 'dreamed': 0.91; 'insane': 0.93; 'mount': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=bNIUCoFvRFIVgoG+VQlxxBGLg5P61Txma78zLSwWWXo=; b=TdcUl9LDcUsIdvjzNdreMw/KBGAA0pI9OTGc6RcpDsRAkK6RCx6ixqfkvDgIF3hmnO jqpb2tBi1x8qS3OcPcrOOmsuukQmxwV8O239EJG/DVxbCz3nRsYy2cEDKm7TkTPRJhzb qF4rjJC+dv0M2DCaDhw4oRhoOydZzDMoDy0Igo/klWdX5meicEO0g/BRJBFm8x13b4tJ suY1DqjW9RxY5ZnfDNGbGjxJmaiY+cYY9lW5vHSaQY9guZEqn1QN/+Rm72tlbqSIBLLC 1UIqf0r88YVkZGxawmDGk5IDHS2oFePR963azET8EskioIBbv3d9UmPENIXP5n48x9/F d9Og== MIME-Version: 1.0 In-Reply-To: <509770C9.8000003@r3dsolutions.com> References: <509770C9.8000003@r3dsolutions.com> Date: Mon, 5 Nov 2012 19:05:48 +1100 Subject: Re: Multi-dimensional list initialization From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352102750 news.xs4all.nl 6929 [2001:888:2000:d::a6]:37568 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32760 On Mon, Nov 5, 2012 at 6:54 PM, Andrew Robinson wrote: > 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. Eh, I meant mutating None's attributes, which is just as insane as I said. > 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". There's been a collection of those around the place. A few memorable ones: EMILYPOST: Bad fork() ETOBACCO: Read on empty pipe EHORSE: Mount failed I may be misremembering, but I'm sure the originals can be found at the other end of a web search. ChrisA