Skip to content

Instantly share code, notes, and snippets.

@sloria
Created June 30, 2013 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sloria/5895751 to your computer and use it in GitHub Desktop.
Save sloria/5895751 to your computer and use it in GitHub Desktop.
# Meh
class Rectangle:
def bottom_right(self):
return Point(self.left + self.width,
self.top + self.height)
# Better to use temporary variables for readability
class Rectangle:
...
def bottom_right(self):
right = self.left + self.width
bottom = self.top + self.height
return Point(right, bottom)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment