Creating superset of list objects?

William Park parkw at better.net
Sun Oct 8 19:27:39 EDT 2000


On Sun, Oct 08, 2000 at 06:36:29PM +0200, Martin von Loewis wrote:
> William Park <parkw at better.net> writes:
> 
> > I've made many private additions to 'Objects/listobject.c', and I
> > now want to move them into its own module.  Can anyone give me
> > pointers as to how I can create a superset of regular list?
> 
> I believe what you want to do is not possible. You can certainly
> create your own list type - but you can't have the interpreter create
> instances of that when you write [x1,x2,x3].
> 
> What you *can* do is to create a constructor function in your module,
> so you can write mymod.list([x1,x2,x3]) which should copy the
> references from the argument list into your list object.
> 
> Regards,
> Martin

Thanks, I sort of guessed as much.  I'm now trying to create my own class
object in my own module.  

---William Park, Open Geometry Consulting




More information about the Python-list mailing list