Description
The library defines multiple types such as FileSystemMovedEvent
, DirMovedEvent
, etc., but does not employ them for on_moved
event handler. Instead, it uses the generic FileSystemEvent
, which somewhat defeats the purpose of having the event-specific types.
When defining a derived event handler class using the explicit types as below, mypy
will complain that it "violates the Liskov substitution principle" as described in https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides, which also makes the definition of handler with the specific types provided inadequate.
def on_moved(self, event: FileSystemMovedEvent | DirMovedEvent): ...
Would it be possible to adjust the types to the specific events expected by each method? The current workaround is to type: ignore
, also defining the purpose of defining the types in the first place.