what does 'for _ in range()' mean?

Peter Hansen peter at engcorp.com
Thu Jul 29 13:17:53 EDT 2004


Matteo Dell'Amico wrote:

> Peter Hansen wrote:
> 
>> Actually, not in the least, but I'm happy to go on faith that
>> you have a point and hope you have managed to communicate it
>> to others. :-|
> 
> Let's try it again: in functional programming languages, you can use 
> pattern-matching, so that you can define functions in a declarative 
> fashion this way:

Oh!  Enlightment dawns.... we were still talking about Ocaml then.
I see.

So to get this back to the point that was being made:

Phil said Ocaml allowed multiple _ in tuple assignments but
that Python did not, while I attempted to correct that assertion by
showing that it in fact did.

David and you were discussing a case involving function languages,
which Python is not, where the use of multiple _ (which now has
syntactical meaning, as opposed to being just an "ignore this" by
convention) is allowed.

Sounds to me like the two discussions are unrelated.

-Peter



More information about the Python-list mailing list