Re: Multi-dimensional list initialization

Discussion in 'Python' started by Chris Angelico, Nov 5, 2012.

  1. 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
    Chris Angelico, Nov 5, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    311
  2. Demian Brecht

    Multi-dimensional list initialization

    Demian Brecht, Nov 5, 2012, in forum: Python
    Replies:
    55
    Views:
    613
    Ethan Furman
    Nov 9, 2012
  3. Chris Rebert

    Re: Multi-dimensional list initialization

    Chris Rebert, Nov 5, 2012, in forum: Python
    Replies:
    2
    Views:
    185
    88888 Dihedral
    Nov 8, 2012
  4. Andrew Robinson

    Re: Multi-dimensional list initialization

    Andrew Robinson, Nov 5, 2012, in forum: Python
    Replies:
    0
    Views:
    217
    Andrew Robinson
    Nov 5, 2012
  5. Demian Brecht

    Re: Multi-dimensional list initialization

    Demian Brecht, Nov 5, 2012, in forum: Python
    Replies:
    0
    Views:
    161
    Demian Brecht
    Nov 5, 2012
Loading...

Share This Page