Subclassing built-in types

Emiliano Molina nothanks at nothere.com
Wed Aug 25 03:21:29 EDT 2004


Where can I find information on how to do this?

Specifically I am concerned about something like:

class NewList(list):
	def __init__(self):
		list.__init__(self)

The above code does not allow the passing of a sequence to populate the 
NewList.

I imagine that the correct way to do it is something like:

class NewList(list):
	def __init__(self,seq):
		list.__init__(self,seq)

but I can't find any documentation that describes what arguments 
list.__init__ may take.

Where can I find that documentation?  I've looked through the manual but 
can't find anything relevant.  Google searches bring up articles that 
talk about code as described in my first example but I can't find 
anything like the second.



More information about the Python-list mailing list