sort one list using the values from another list

Kent Johnson kent at kentsjohnson.com
Mon Feb 27 21:41:39 EST 2006


Simon Sun wrote:
> Magnus Lycka wrote:
> 
>>Is there something here I can't see, or did you just
>>change a variable name and present that as another
>>solution?
> 
> Heh, I have use python for a very short time. Base your statements, I test
> in python, found `_' is a valid variable name. So I don't know it is a just
> a plain variable or like something pattern matching in Haskell.

_ is just a plain variable name in Python. It is sometimes when a 
variable is needed to receive a value that won't be used. So your 
example was correct and idiomatic but functionally identical to mine.

Kent



More information about the Python-list mailing list