[Python-Dev] Re: Sets: elt in dict, lst.include - really begs for a PEP
Wed, 31 Jan 2001 12:14:49 +0200 (IST)
On Wed, 31 Jan 2001 01:47:10 -0800 (PST), Ka-Ping Yee <email@example.com> wrote:
> Okay, i have written a draft PEP that tries to combine the
> "elt in dict", custom iterator, and "for k:v" issues into a
> coherent proposal. Have a look:
Er....one problem with first reading: you forgot to mention in the
while loop description that 'else:' would be executed if the exception
is raised, so the 'break' is a pseudo-break'.
Basic response: I *love* the iter(), sq_iter and __iter__ parts.
I tremble at seeing the rest.
Why not add a method to dictionaries .iteritems() and do
for (k, v) in dict.iteritems():
(dict.iteritems() would return an an iterator to the items)
Moshe Zadka <firstname.lastname@example.org>
This is a signature anti-virus.
Please stop the spread of signature viruses!
Fingerprint: 4BD1 7705 EEC0 260A 7F21 4817 C7FC A636 46D0 1BD6