shawn wrote: > I am trying to make a subtype of a string. Initially it will have no > new methods or attributes, the C equivalent of: > > class myStr(str): > pass > > I have experimented a bit, but am currently making a mess of it. Does > anybody have an example they can point to of inheriting from a builtin, > or a suggestion to point me in the right direction?
The Python source distribution contains an example module xxsubtype that shows how to subclass builtins: http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Modules/xxsubtype.c?rev=2.15.2.1&view=markup -- Gerhard -- http://mail.python.org/mailman/listinfo/python-list