A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-April/044360.html below:

[Python-Dev] dict.sortedkeys()

[Python-Dev] dict.sortedkeys() [Python-Dev] dict.sortedkeys()Robert Brewer fumanchu at amor.org
Sat Apr 17 16:21:26 EDT 2004
[Jeff Epler]
> Factor sorted into a function that returns a sorted copy:
>     def sorted(seq):
>         seq = list(seq)
>         seq.sort()
>         return seq
> 
> or one that sorts in place:
>     def sorted(seq):
>         seq.sort()
>         return seq
> 
> Now you can write your one-liner:
> for i in sorted({}.keys()):
>     ...

Yes, of course. But I'm working on a large business app framework. That
means either:

1. Writing sorted into every module where it's needed.
2. Putting sorted into a package somewhere, which makes it longer and
uglier with absolute referencing.
3. Customizing consumers' Python install.

...none of which are good options.


[Bob Ippolito]
> I'm pretty sure that in Python 2.4 you will be able to say
sorted(seq).

Excellent! That'll do nicely. :)


-another bob

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4