Python idioms

I came across a document with lots of tips for efficient Python programming.

Advertisements
This entry was posted in sympy. Bookmark the permalink.

One Response to Python idioms

  1. asmeurer says:

    Good find, but I think some of these are outdated. For example, you can use list.sort(reverse=True) instead of list.sort(); list.reverse(), sort(key=key) instead of decorate/un-decorate, and as far as readability goes, while True instead of while 1 is slightly more Pythonic (readable) IMO.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s