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

get_codec modifies its argument #78

Closed
jeromekelleher opened this issue May 3, 2018 · 1 comment
Closed

get_codec modifies its argument #78

jeromekelleher opened this issue May 3, 2018 · 1 comment
Labels
Milestone

Comments

@jeromekelleher
Copy link
Member

The get_codec function modifies its argument, popping the "id" key. This can lead to surprising behaviour such as:

config = {"id": "json"}
codec = get_codec(config) # Works
codec = get_codec(config) # fails.

I suggest adding config = dict(config) at the start of the function. The performance implications should be minimal I think.

@alimanfoo
Copy link
Member

SGTM, although I think there may be some other code that relies on the "id" having been popped. May need some adjustment. PR welcome.

@jeromekelleher jeromekelleher mentioned this issue May 4, 2018
8 tasks
@alimanfoo alimanfoo added this to the 0.6.0 milestone May 13, 2018
@alimanfoo alimanfoo added the bug label May 13, 2018
anandtrex pushed a commit to anandtrex/numcodecs that referenced this issue May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants