[portland] Still Having List/Tuple Problems
kirby.urner at gmail.com
Tue Apr 22 02:00:54 CEST 2008
Interesting discussion, just flagged it for additional feedback
on edu-sig here:
On Wed, Apr 16, 2008 at 10:35 PM, Dylan Reinhardt
<python at dylanreinhardt.com> wrote:
> On Wed, Apr 16, 2008 at 6:09 PM, kirby urner <kirby.urner at gmail.com> wrote:
> > i.e. as iterables, dictionaries already have a default "step though"
> > behavior, which is to go through the keys.
> > So you don't have to explicitly fire the keys() method, and doing
> > so is less generic i.e. takes advantage of this being a dictionary,
> > versus an iterable.
> With all due respect to idiomatic Python, something important can be
> lost when you refine code. Treating all iterators the same is more
> general and more pleasing to the eye... but it is also less explicit
> and, therefore, less readable.
> Because iterables are ordinarily *ordered*, the risk here is that you
> may obscure the special *non-ordered* character of a key listing.
> Using .keys() might be ugly, but it is explicit and unsurprising.
> Portland mailing list
> Portland at python.org
More information about the Portland