Using an object inside a class

Ethan Furman ethan at
Mon Jan 23 15:51:06 EST 2012

Gary Herron wrote:
> If the method does not bind it, then Python will look in the class for 
> foo.  This could work
> class Class1:
>      foo = whatever # Available to all instances
>      def __init__(self):


               ^- needs the self reference or will not work


More information about the Python-list mailing list