Created
November 24, 2011 23:07
-
-
Save kylefox/1392484 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you can refactor this, please do :)