[portland] Still Having List/Tuple Problems

kirby urner 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:

http://mail.python.org/pipermail/edu-sig/2008-April/008515.html

Kirby


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.
>
>  $.02,
>
>  Dylan
>
>
> _______________________________________________
>  Portland mailing list
>  Portland at python.org
>  http://mail.python.org/mailman/listinfo/portland
>


More information about the Portland mailing list