Created
November 6, 2012 23:38
-
-
Save wesrog/4028492 to your computer and use it in GitHub Desktop.
New favorite Python idiom
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
# This | |
def fixture_create_user(*args, **kwargs): | |
username = kwargs.pop('username', 'test') | |
seller = kwargs.pop('seller', False) | |
buyer = kwargs.pop('buyer', False) | |
voter = kwargs.pop('voter', False) | |
curr_id = kwargs.pop('curr_id', 1) | |
banned = kwargs.pop('banned', 'N') | |
account_closed = kwargs.pop('account_closed', 'N') | |
auto_activate = kwargs.pop('auto_activate', True) | |
# Instead of this | |
def fixture_create_user( | |
username='test', | |
selling=False, | |
buyer=False, | |
voting=False, | |
curr_id=1, | |
ban_database='N', | |
account_closed='N', | |
auto_activate=True): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment