newbie question on class vars

Paul Moore gustav at morpheus.demon.co.uk
Mon Oct 7 15:45:56 EDT 2002


JXSternChangeX2R <JXSternChangeX2R at gte.net> writes:

> late bulletin:  saying "self.__gvar" inside fn1 and fn2 fixes, but I
> thought the idea was to avoid saying "self." all the time.

Nope, self.__gvar is entirely correct. You never get implicit access
to class variables. It's the old "explicit is better than implicit"
principle again.

Paul



More information about the Python-list mailing list