Perl/Python/Ruby common backend (Parrot, can Ruby play too?)

Alex Martelli aleaxit at yahoo.com
Tue Aug 7 16:18:16 EDT 2001


"Andrew Dalke" <dalke at acm.org> wrote in message
news:9kpeft$kbm$1 at slb4.atl.mindspring.net...
    ...
> tweak the class definitions in-place.  She chose Tcl (with an
> object extension) over Python because Python's ability to add
> new methods is not obvious[*] and because existing instances
> are not updated with the new class definitions

If you want existing instances to NOT be changed, in Python,
just leave the existing class object alone and build a new one.
E.g,
class theclass(theclass): pass
and now you can tweak (the new object bound to name)
theclass without altering any existing instances (if some
existing instance is of a class derived from theclass, and
that derived class uses the theclass.whatever(self) way to
call base class methods, you COULD get surprises though:).


Alex






More information about the Python-list mailing list