Message33570
| Author |
gvanrossum |
| Recipients |
| Date |
2002年06月06日.16:29:55 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Logged In: YES
user_id=6380
Go ahead and check it in.
Strings and unicode also need to support slices. While
"hello"[::2] is silly, it's useful to be able to write
"hello"[slice(1,-1)].
I think array needs more work -- first 'array.array' should
be made into a type object that can be invoked as a
constructor and subclassed. That would be nice, yes, but is
a lower priority for me ATM.
Off-topic aside: the change you had to make to
PyString_Format() and its Unicode cousin suggests that we
need a better way to decide if something is really a
mapping... E.g. this now gives a confusing error message:
"%(foo)s %(bar)s" % [1,2,3]
I wonder how many other places in the code make naive
mapping tests (and of course operator.isMappingType becomes
totally unreliable). Maybe the presence of a keys() method
together with a __getitem__ method should be used as a
standard test for mapping-ness? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 15:00:48 | admin | link | issue400998 messages |
| 2007年08月23日 15:00:48 | admin | create |
|