Skip to content

Instantly share code, notes, and snippets.

@tonyseek
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save tonyseek/935f9366eb001da4f906 to your computer and use it in GitHub Desktop.

Select an option

Save tonyseek/935f9366eb001da4f906 to your computer and use it in GitHub Desktop.
from operator import itemgetter
class Step(tuple):
location = property(itemgetter(0))
milestone = property(itemgetter(1))
step = Step(['nowhere', 'nothing'])
assert step.location == 'nowhere'
assert step.milestone == 'nothing'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment