I'm a python addict !
Paul McGuire
ptmcg at austin.rr.com
Mon Jan 26 15:37:41 EST 2009
On Jan 26, 2:06 pm, "J. Cliff Dyer" <j... at sdf.lonestar.org> wrote:
>
> Thanks. That makes sense. But your example creates a new instance of
> the new class each time, rather than changing the class of a persistent
> instance, as the original example, to which I was responding, did.
>
Look closer. The line that creates a new instance is commented out,
with the notation "how you have to do it in C++ and Java". The actual
Python code is just below, and just assigns a new class to
self.__class__, as in the original example.
-- Paul
More information about the Python-list
mailing list