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

Make schema dictionaries immutable #16

Closed
janssenhenning opened this issue Feb 4, 2021 · 0 comments
Closed

Make schema dictionaries immutable #16

janssenhenning opened this issue Feb 4, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@janssenhenning
Copy link
Contributor

janssenhenning commented Feb 4, 2021

One problem I noticed during development of the parsers, is that it is very easy to mutate the schema dictionaries since it is just lists and dicts. So forgetting to copy some entry before doing something with it can have unintended consequences. This is not ideal, when there could be a variety of tools in the future relying on the schema dict

I have some Ideas to implement a subclass of UserDict (the same thing I did in #15 to get a case insensitive key lookup), which can prevent modifications to itself and will immediately raise an error if someone tries.

This is a reminder to myself that I should do something about this at some point

@janssenhenning janssenhenning self-assigned this Feb 4, 2021
@janssenhenning janssenhenning added the enhancement New feature or request label Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant