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
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.
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.
The text was updated successfully, but these errors were encountered:
BoboTiG
added a commit
to BoboTiG/watchdog
that referenced
this issue
Aug 11, 2024
The library defines multiple types such as
FileSystemMovedEvent
,DirMovedEvent
, etc., but does not employ them foron_moved
event handler. Instead, it uses the genericFileSystemEvent
, 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.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.The text was updated successfully, but these errors were encountered: