
Hidden features of Python - niyazpk
http://stackoverflow.com/q/101268/184
======
ubasu
Older discussion:

<http://news.ycombinator.com/item?id=1512930>

------
phzbOx
I already knew mostly everything in it (Time to switch to a new language!) but
here's two that I didn't know:

1.

    
    
      from __future__ import braces
    

Use {} to delimit scope!

2.

    
    
      try:
          import readline
      except ImportError:
          print "Unable to load readline module."
      else:
          import rlcompleter
          readline.parse_and_bind("tab: complete")
    
    

Used to use [tab]-completion in terminal. One could correctly argue that using
iPython would be smarter.. but sometime you are working remotely and don't
want to get out of the terminal and install, etc.

~~~
ryanbraganza
Make sure you actually try running "from __future__ import braces"

~~~
ohgodthecat

        >>> from __future__ import braces
          File "<stdin>", line 1
        SyntaxError: not a chance

------
zalew
most of these features are so _hidden_ , you learn them the first few nights
with python

