You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Okay, let's see... Right now, @Component() does nothing more than "This is a dataclass with eq=False". I think the simple solution would be to create a base class Component instead, and simply use isinstance(component, Component). No idea whether that'd limit our design space. It might be worth it to allow arbitrary objects as components, and just recommend to use @dataclass. It has been shown to be a good idea, but with the proposed change, it'd be one more thing developers would have to remember; Classes inheriting dataclasses are not automatically dataclasses themselves. Opinions, @janEntikan, @owlen?
I really think that owlen@6c386d5#diff-aea33697fd7aee7c291e955864ea202bR63-R64 solves most if not all of the issue, as the common mistake is simply forgetting the parenthesis. That's a simple enough test that covers all of the times I encountered it, and probably most of those @janEntikan mentioned. I would start with this, and see if there are more complaints after that. Certainly wouldn't change the hierarchy structure if you don't have to.
It would be useful if an error were raised if, say, a type instead of a Component were passed into the create_entity function.
The text was updated successfully, but these errors were encountered: