Closed benoit74 closed 1 month ago
Why would it be sad to fix the signature? Is this type useless? If so the issue should be about deleting it rather than this collateral
The zimscraperlib.zim.items.Item
type is useful, so this is why I do not want to fix the signature which is correct. But then the code should really return such an object, and not a libzim.writer.Item
.
The problem is that today I can't use item.mimetype
because the type checker complains, and I can't use item.get_mimetype()
because it fails at runtime.
Ah I thought it was the other way around. Indeed we should return it.
In fact type hint is wrong, it is a writing item. We should fix type hint with libzim reading item which is sufficient.
Archive.get_item
type hint suggest that it returns azimscraperlib.zim.items.Item
while in fact it return alibzim.writer.Item
.We should either fix the code (preferably) or the type hint (would be sad)