python idioms: (was: a really cool python feature)
nascheme at enme.ucalgary.ca
Thu May 11 13:51:17 EDT 2000
Grant Griffin <g2 at seebelow.org> wrote:
>Forgive a possible newbie FAQ, but is there a page of Python
>idoms like this?
Python doesn't have too many idoms and that's a good thing.
string.join is not an idom. That function is for exactly that
usage. The only problem would be finding it in the library
reference. The only really useful idioms I can think of right
using default arguments to simulate closures:
a = 1
and doing some stuff if the module is '__main__':
if __name__ == '__main__':
Can anyone think of more (ignoring tricks with lambda, reduce,
filter, and map)?
"Everyone can be taught to sculpt: Michelangelo would have had to
be taught how not to. So it is with the great programmers" -- Alan Perlis
More information about the Python-list