On Jan 26, 2:06 pm, "J. Cliff Dyer" <j...@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 -- http://mail.python.org/mailman/listinfo/python-list