[EMAIL PROTECTED] wrote:
> How can an object replace itself using its own method? See the
> following code

[code deleted]

At the risk of creating totally incomprehensible and
unmaintainable code, you need two things:

First, you can change the class of any new style
object by assigning to the __class__ attribute.

Second, you can create a new style class
on the fly with the three operand type(a, b, c) method.
See the builtin methods in the doc.

It's quite straightforward if you know what you're
doing. What's hard is to create a conceptual model
that won't be an instant winner in an obfuscated code
contest.

John Roth

>

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

Reply via email to