[Python-Dev] Re: [Patches] [Patch #101175] Fix slight bug in the Ref manual docs on listcomprehensions (original) (raw)

Greg Ewing greg@cosc.canterbury.ac.nz
Wed, 16 Aug 2000 18:02:23 +1200 (NZST)


Guido hates it because it's almost certainly an error.

Yes, I know what you meant. I was just trying to point out that, as far as I can see, it's only Guido's opinion that it's almost certainly an error.

Let n1 be the number of times that [x if y] appears in some program and the programmer actually meant to write something else. Let n2 be the number of times [x if y] appears and the programmer really meant it.

Now, I agree that n1+n2 will probably be a very small number. But from that alone it doesn't follow that a given instance of [x if y] is probably an error. That is only true if n1 is much greater than n2, and in the absence of any experience, there's no reason to believe that.

A zip with no arguments has no universe to zip over; a listcomp without iterators has no universe to build on... The intent here is to supply a flexible and highly expressive way to build lists out of other sequences; no other sequences, use something else.

That's a reasonable argument. It might even convince me if I think about it some more. I'll think about it some more.

if you choose not to do the work anymore, you took yourself out of the loop.

You're absolutely right. I'll shut up now.

(By the way, I think your mail must have gone astray, Tim -- I don't recall ever being offered ownership of a PEP, whatever that might entail.)

Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+