Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32760
| 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> <509770C9.8000003@r3dsolutions.com> |
|---|---|
| Date | 2012-11-05 19:05 +1100 |
| Subject | Re: Multi-dimensional list initialization |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3277.1352102750.27098.python-list@python.org> (permalink) |
On Mon, Nov 5, 2012 at 6:54 PM, Andrew Robinson <andrew3@r3dsolutions.com> wrote: > 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. 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
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Multi-dimensional list initialization Chris Angelico <rosuav@gmail.com> - 2012-11-05 19:05 +1100
csiph-web