-
Notifications
You must be signed in to change notification settings - Fork 137
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
Obviously handle scrub_fields in rollbar.init() #235
Conversation
These seems okay to me. I guess I would have set |
For the original issue (#234), wouldn't this potentially be a problem for every param, not just |
It will. |
rollbar/__init__.py
Outdated
@@ -276,7 +276,7 @@ def _get_pylons_request(): | |||
|
|||
## public api | |||
|
|||
def init(access_token, environment='production', **kw): | |||
def init(access_token, environment='production', scrub_fields=list(), **kw): |
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 potentially dangerous.
It's discouraged to define default argument values with mutable objects.
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments
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.
Yeah, you are right!
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.
It isn't an issue here because the default isn't used instead it is just a falsey sentinel, but yeah a None
would work just as well.
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.
@rokob
You're right, it isn't used now.
But who knows what will be in future.
Can you guarantee next contributor won't overlook that?
My patch for #234