itemadapter icon indicating copy to clipboard operation
itemadapter copied to clipboard

ADAPTER_CLASSES may not supported appendleft

Open VMRuiz opened this issue 9 months ago • 2 comments

ADAPTER_CLASSES is defined as Iterable

https://github.com/scrapy/itemadapter/blob/98be1281ec11664da93f836861f81734382ce4ea/itemadapter/adapter.py#L271

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.

VMRuiz avatar May 07 '24 10:05 VMRuiz