Re: adding a method to an existing builtin class

2010-09-26 Thread Chris Rebert
On Sun, Sep 26, 2010 at 9:07 AM, TP wrote: > Hi everybody, > > Today I have learned a bit of the news of Python 3.0 compared to 2.4 > version. > > By the way, I have asked myself if it is possible to add a method to a > builtin type The built-in types' classes are immutable; you can only add/over

adding a method to an existing builtin class

2010-09-26 Thread TP
Hi everybody, Today I have learned a bit of the news of Python 3.0 compared to 2.4 version. By the way, I have asked myself if it is possible to add a method to a builtin type as 'unicode': >>> a="foo" >>> type(a) >>> print(dir(a)) ['__add__', ..., 'zfill'] For example, I would like to add a