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 BaseObj strict #11

Open
ramaro opened this issue Jun 30, 2021 · 0 comments
Open

Make BaseObj strict #11

ramaro opened this issue Jun 30, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ramaro
Copy link
Member

ramaro commented Jun 30, 2021

Currently BaseObj accepts any keyword args, even ones not defined via self.need() or self.optional(). This means that any unknown keywords will blindly have no effect.

We should make BaseObj check keywords against the ones set in self.need and self.optional() and raise an Exception on unknown keywords.

And maybe do this via a new BaseObjStrict class, as the original BaseObj behaviour might be needed in some use cases (like passing keyword params via the inventory, where it's not ideal to hardcode all params via self.need() or self.optional().

@ramaro ramaro added the enhancement New feature or request label Jun 30, 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