Skip to content

Instantly share code, notes, and snippets.

@sloria
Created June 30, 2013 16:01
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/5895726 to your computer and use it in GitHub Desktop.
Save sloria/5895726 to your computer and use it in GitHub Desktop.
class ParagraphEditor:
...
def highlight(self, rectangle):
self.reverse(rectangle)
# Better
class ParagraphEditor:
...
highlight = reverse # More readable, more composable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment