Want to reduce steps of an operation with dictionaries

Fredrik Lundh fredrik at pythonware.com
Wed Oct 25 01:56:18 EDT 2006


Ben Finney wrote:

>> How can I do this with one line of instruction?
> 
> Why one line?
> 
> As a general piece of advice, try writing dumb, obvious code that
> actually does the transformation you want, and then let us see
> that. Don't try to compress things into fewer lines unless that
> actually makes it clearer to read.

I was about to suggest adding something along these lines to "import 
this", but then I realized that it had to be written on one line to
fit into that module, so I dropped the idea.

</F>




More information about the Python-list mailing list