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
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.
mypy 1.5.0 has an additional warning:
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
The text was updated successfully, but these errors were encountered: