Quickie – Pythonic “if” statements

In reference to my previous post, a reader writes:

You don’t need parens around your if conditions in Python – and it’s more Pythonic not to have them…

if size <= 0:
    return ""

Both statements are true. As an old C hack (and current heavy JS user) "if" statements Just Don't Look Right to me w/o the enclosing parens. Therefore, I thought the reader's point bore repeating.

Share and Enjoy:
  • Twitter
  • Facebook
  • Digg
  • Reddit
  • HackerNews
  • del.icio.us
  • Google Bookmarks
  • Slashdot
This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.