Thursday, May 24, 2012

Hidden features of Python

I learned about this link with many useful hidden features of Python via Eduardo.

I particularly like:

  • the use of enumerator in loops: for i,x in enumerate(array)
  • decorators as a simple way of enhancing methods: @method
  • one-line swapping of variables: a,b=b,a

No comments:

Post a Comment