Skip to content
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

use of mutable object in python signatures #43

Closed
ooldham opened this issue Sep 25, 2015 · 2 comments
Closed

use of mutable object in python signatures #43

ooldham opened this issue Sep 25, 2015 · 2 comments

Comments

@ooldham
Copy link

ooldham commented Sep 25, 2015

Examining v1.6.6 - I see 3 methods with mutable object in signature.
This is never a good idea.

def convert_kv(key, val, attr_type, attr={}):
def convert_bool(key, val, attr_type, attr={}):
def convert_none(key, val, attr_type, attr={}):

These should be changed to:
def convert_kv(key, val, attr_type, attr=None):
def convert_bool(key, val, attr_type, attr=None):
def convert_none(key, val, attr_type, attr=None):

And the following - or something similar, inserted after each LOG statement found in each method.

    attr = dict() if attr is None else attr
    if not isinstance(attr, dict):
        raise TypeError("Unexpected type: attr={a}, type={t} vs dict".format(a=attr, t=type(attr).__name__))
@quandyfactory
Copy link
Owner

This will be fixed in v1.7.15.

@quandyfactory
Copy link
Owner

I have resolved this in version 1.7.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants