Creating superset of list objects?
Martin von Loewis
loewis at informatik.hu-berlin.de
Sun Oct 8 12:36:29 EDT 2000
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
More information about the Python-list
mailing list