Title: RE: A scoping question

> myBaseClass.AddChild(file2.NextClass())
> [snip]
> class NextClass:
>     def __init__(self):
>         for eachChild in myBaseClass.MyChilds:  # <- ERROR
>             ...


I never assumes globals in my classes. always pass them as parameters. it's safer and better to understand later. Also, makes it easier to reuse the code later on.

myBaseClass.AddChild( file2.NextClass( myBaseClass ) )


Gabriel

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to