scrapy/itemadapter

tests: Factory doesn't seem to be needed in attr.s example

Closed this issue · 1 comments

kmike commented
@attr.s
class AttrsItem:
    name = attr.ib(default=attr.Factory(lambda: None), metadata={"serializer": str})
    value = attr.ib(default=attr.Factory(lambda: None), metadata={"serializer": int})

Why isn't default=None enough?

TBH I don't remember checking the docs too much for this, I think I just translated the dataclass example.
Addressed by 0d16af4