kadet icon indicating copy to clipboard operation
kadet copied to clipboard

Make BaseObj strict

Open ramaro opened this issue 4 years ago • 0 comments

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 avatar Jun 30 '21 09:06 ramaro