hober.py:16: error: Item "None" of "Optional[DirEntry[str]]" has no attribute "stat" [union-attr]
hober.py:16: error: Invalid self argument "stat_result" to attribute function "st_mtime" with type "Callable[[stat_result], float]" [misc]
Found 2 errors in 1 file (checked 1 source file)
This is likely an issue with mypy's "type context", which infers different types based on the "expected" type. Here it obviously goes wrong, but chances are it's hard to fix it without breaking some other use case.
Activity
drvink commented on Mar 12, 2022
This is still broken in mypy 0.940:
JelleZijlstra commented on Mar 12, 2022
This is likely an issue with mypy's "type context", which infers different types based on the "expected" type. Here it obviously goes wrong, but chances are it's hard to fix it without breaking some other use case.
Extend special case for context-based typevar inference to typevar un…