"special_dragonfly" <[EMAIL PROTECTED]> writes:

> I've managed to solve the problem, I really was just being a
> dunce.

Doubtful; but at this stage we can't tell, because we still don't know
what it is you're actually trying to *do*.

> Here's how incase anyone is wondering:
> 
> class MyClass:
>     def __init__(self):
>         name=""
> dict={}
> dict[0]=[]
> dict[0].append(MyClass())
> dict[0][0].name="Hello"
> print dict[0][0].name

It's not clear why you are using the value 0 for a dictionary key
here; nor why you're assigning an attribute to an object after
creating the object. Neither of them are errors, but without context
it's hard to know what advice to give.

-- 
 \          "When we call others dogmatic, what we really object to is |
  `\        their holding dogmas that are different from our own."  -- |
_o__)                                                   Charles Issawi |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to