-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/foldit leaderboard #394
Conversation
Don't merge until we make the current course be passed by default to get_tops_n, and add an attribute that allows more courses/runs to be added to "course_list" |
@staticmethod | ||
def get_tops_n(n, puzzles=['994559']): | ||
def get_tops_n(n, puzzles=['994559'], course_list=[]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dangerous, generally. I don't think you have a problem in this function as it stands, but using mutable values as default arguments in python often leads to memory leaks. Better practice, generally, is to use None
, and then at the top of the function, say
if course_list is None:
course_list = []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, in fact, since the only thing you do w/ course list is check for []
and do one query, or do a different query, you can just use None
as your signal value instead.
👍 |
1 similar comment
👍 |
…dules Hide errors from non-staff users
mattdrayer/fix_broken_tests: Updated stale dates throughout test suite
* dylanrhodes/cme_unpaid_users: Include unpaid registrations in user data table
sorts the foldit top_n list by course
@jkarni
@johnhess