Python shortcuts

Posted by lyrae on Stack Overflow See other posts from Stack Overflow or by lyrae
Published on 2009-06-12T04:39:21Z Indexed on 2010/06/16 3:52 UTC
Read the original article Hit count: 211

Filed under:
|
|

Python is filled with little neat shortcuts.

For example:

self.data = map(lambda x: list(x), data)

and (although not so pretty)

tuple(t[0] for t in self.result if t[0] != 'mysql' and t[0] != 'information_schema')

among countless others.

In the irc channel, they said "too many to know them all".

I think we should list some here, as i love using these shortcuts to shorten & refctor my code. I'm sure this would benefit many.

© Stack Overflow or respective owner

Related posts about python

Related posts about shortcut