Re: c[:]()

2007-06-01 Thread dackz
This discussion has gone in more circles than Earth has gone 'round the Sun, but it seems you should consider the following: 1) Sequences and functions serve fundamentally different purposes in Python. One is for containing objects, the other is for executing an action. (And yes, I'm aware that th

Why does list.__getitem__ return a list instance for subclasses of the list type?

2007-02-06 Thread dackz
>>> class ListyThing(list): pass ... >>> assert isinstance(ListyThing()[:], ListyThing) # I expect True! Traceback (most recent call last): File "", line 1, in AssertionError >>> type(ListyThing()[:]) # I expect ListyThing! I don't find this intuitive. Is this intentional? I believe this could