Skip to content

Instantly share code, notes, and snippets.

@kylefox
Created November 24, 2011 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kylefox/1392484 to your computer and use it in GitHub Desktop.
Save kylefox/1392484 to your computer and use it in GitHub Desktop.
class SpecialThing(Thing):
def save(self, *args, **kwargs):
# If only I could `my_kwarg = kwargs.delete('my_kwarg')
my_kwarg = 'my_kwarg' in kwargs
if my_kwarg:
kwargs.pop('my_kwarg')
result = super(SpecialThing, self).save(*args, **kwargs)
if my_kwarg:
self.do_more_stuff()
return result
@kylefox
Copy link
Author

kylefox commented Nov 24, 2011

If you can refactor this, please do :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment