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
However, in the docs it's suggested to use appendleft method which is not part of the Iterable API.
This causes errors with tools like mypy:
error: "Iterable[Type[AdapterInterface]]" has no attribute "appendleft" [attr-defined]
Either the class type should be changed to List or other classes that may support appendleft or a different way to extend ADAPTER_CLASSES should be given.
The text was updated successfully, but these errors were encountered:
ADAPTER_CLASSES was originally typed as a Deque, this was most recently changed in #71 (#74). The appendleft example works in the context of the default implementation, this is mentioned in the docs:
The default implementation uses a collections.deque to support efficient addition/deletion of adapters classes to both ends, but if you are deriving a subclass (see the section on extending itemadapter for additional information), any other iterable (e.g. list, tuple) will work.
I can think of the following, though there might be a more correct and compact solution:
ADAPTER_CLASSES
is defined asIterable
itemadapter/itemadapter/adapter.py
Line 271 in 98be128
However, in the docs it's suggested to use
appendleft
method which is not part of the Iterable API.This causes errors with tools like mypy:
error: "Iterable[Type[AdapterInterface]]" has no attribute "appendleft" [attr-defined]
Either the class type should be changed to List or other classes that may support appendleft or a different way to extend
ADAPTER_CLASSES
should be given.The text was updated successfully, but these errors were encountered: