[Python-Dev] sets, scanf (original) (raw)

Mark.Lake at aigfpc.com Mark.Lake at aigfpc.com
Thu May 20 13:31:09 EDT 2004


Just a couple of modest suggestions for new features. Nothing earth-shattering here but I think these would give a lot of bang for the buck.

  1. sscanf functionality: I know this has been discussed for years, but it's time to bite the bullet and do it.

  2. Sets are a useful addition to the language, but sorted sets (and dictionaries) would be more useful. C++/Java/C# all provide these types. In particular I'd like to see:

A. Dictionaries support union, intersection, and symmetric difference operations as sets do. B. (Sorted) Dictionaries and sets support slicing operations: E.g. dict['a':'z'] should return a sub-dictionary with all the keys between 'a' and 'z'. C. Binary searching for items in sorted sequence and mapping types. D. Ability to handle multiple getitems at once in sequence and mapping types (Akin to what can be done in numarray). Certainly there is no good reason why lists/tuples shouldn't support list[iterable] (not to be confused with list(iterable)) which returns or dictionaries support something like dict.getm(iterable).

Mark Lake

-------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20040520/cb63f0a8/attachment.html



More information about the Python-Dev mailing list