[Python-Dev] Re: Sets: elt in dict, lst.include - really begs for a PEP
Thomas Wouters
thomas@xs4all.net
Wed, 31 Jan 2001 20:14:58 +0100
[ Trimming CC: line ]
On Wed, Jan 31, 2001 at 11:50:10AM -0500, Barry A. Warsaw wrote:
> Moshe, I had exactly the same reaction and exactly the same idea. I'm
> a strong -1 on introducing new syntax for this when new methods can
> handle it in a much more readable way (IMO).
Same here. I *might* like it if iterators were given a format string (or
tuple object, or whatever) so they knew what the iterating code expected
(so something like this:
for x,y,z in obj
would translate into
iterator(obj)("(x,y,z)")
or maybe just
iterator(obj)((None,None,None))
or maybe even just
iterator(obj)(3) # that is, number of elements
or so) but I suspect it might be too cute (and obfuscated) for Python,
especially if it was put to use to distingish between 'for x:y in obj' and
'for x,y in obj'.
--
Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!