Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Multi-dimensional list initialization

Reply
Thread Tools

Re: Multi-dimensional list initialization

 
 
Andrew Robinson
Guest
Posts: n/a
 
      11-05-2012
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 "<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...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
initialization of array as a member using the initialization list aaragon C++ 2 11-02-2008 04:57 PM
array initialization in initialization list. toton C++ 5 09-28-2006 05:13 PM
Initialization of non-integral type in initialization list anongroupaccount@googlemail.com C++ 6 12-11-2005 09:51 PM
Initialization via ctor vs. initialization via assignment Matthias Kaeppler C++ 2 07-18-2005 04:25 PM
Default Initialization Vs. Value Initialization JKop C++ 10 09-22-2004 07:26 PM



Advertisments