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


Groups > comp.lang.python > #32759 > unrolled thread

Re: Multi-dimensional list initialization

Started byAndrew Robinson <andrew3@r3dsolutions.com>
First post2012-11-04 23:54 -0800
Last post2012-11-04 23:54 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#32759 — Re: Multi-dimensional list initialization

FromAndrew Robinson <andrew3@r3dsolutions.com>
Date2012-11-04 23:54 -0800
SubjectRe: Multi-dimensional list initialization
Message-ID<mailman.3276.1352102057.27098.python-list@python.org>
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...

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web