Unified Type/class

Jason Orendorff jason at jorendorff.com
Fri Jan 25 12:30:33 EST 2002


Vincent Foley wrote:
> I'm no expert on the Python language, or OO programming, but it's
> possible in the language Ruby <www.ruby-lang.org> to add new methods to
> existing classes.  For example, it is possible to had a rot13 method to
> the String class.  Is this one of the things this Python type and class
> unification renders possible?

No.  If you could provide an example that's actually useful,
maybe we can convince the Python dev team to include that in
a future release.  (C:

Anyway:

  >>> print "clguba unf guvf ohvyg-va".encode('rot13')
  python has this built-in

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list