Skip to content

Instantly share code, notes, and snippets.

@ianawilson
Created July 19, 2012 16:06
Show Gist options
  • Save ianawilson/3144970 to your computer and use it in GitHub Desktop.
Save ianawilson/3144970 to your computer and use it in GitHub Desktop.
# if we get both or neither, no good
if not (bool(timeAssignment) ^ bool(dropTake)):
raise DropError('drop() takes either a ' + self.family.RecurringTimeAssignment.__name__ + ' or ' + self.family.DropTake.__name__ + ' as an argument but not both nor neither')
if timeAssignment and not type(timeAssignment) == self.family.RecurringTimeAssignment:
raise TypeError('timeAssignment must be a ' + self.family.RecurringTimeAssignment.__name__)
if dropTake and not type(dropTake) == self.family.DropTake:
raise TypeError('dropTake must be a '+ self.family.DropTake.__name__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment