-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
mypy 1.5.0 has an additional warning:
zyte_common_items/base.py:53: error: Trying to assign name "_unknown_fields_dict" that is not in "__slots__" of type "zyte_common_items.base.Item" [misc]
zyte_common_items/base.py:77: error: Trying to assign name "_unknown_fields_dict" that is not in "__slots__" of type "zyte_common_items.base.Item" [misc]
Item doesn't define __slots__ but its base class _ItemBase does (and it includes _unknown_fields_dict). _ItemBase is a normal class, Item is decorated with @attrs.define. There are some entries about attr classes and __slots__ in the mypy 1.5.0 changelog, but I don't see if it's a false positive or a newly detected problem in our code. python/mypy#15639 is likely the change that causes this.
Also related:
https://mypy.readthedocs.io/en/stable/class_basics.html#slots
https://www.attrs.org/en/stable/examples.html#slots
https://www.attrs.org/en/stable/glossary.html#term-slotted-classes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels