adriangb / di

Pythonic dependency injection
https://www.adriangb.com/di/
MIT License
303 stars 13 forks source link

refactor: remove the unused `_state` slot from the `Container` #94

Closed SamWarden closed 1 year ago

SamWarden commented 1 year ago

The __slots__ of the Container class has a declared _state attribute that is never used internally. Is there a reason for declaring it, maybe it should be removed? I found a commit with the first addition of this attribute, but I still don't see a reason for it. If there is, maybe it should be documented with a comment?

adriangb commented 1 year ago

I think you’re right. Generally it does not hurt to have extra slots and there’s no automated mechanism to catch them. Hence why this slipped through the cracks. Thanks for taking a careful look.