Skip to content

Commit e4d8563

Browse files
Fix mypy false positive.
As reported in python/mypy#12682, mypy didn't recognise `bool` as a `TypeGuard[T]` for `Optional[T]`. However it doesn't flag using `None` as a typeguard in `filter` which behaves exactly the same. * sphinx_polyversion/git.py
1 parent ac80604 commit e4d8563

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinx_polyversion/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,4 +535,4 @@ async def handle(ref: GitRef) -> GitRef | None:
535535
async for ref in _get_all_refs(root):
536536
tasks.append(handle(ref))
537537

538-
return tuple(filter(bool, await asyncio.gather(*tasks)))
538+
return tuple(filter(None, await asyncio.gather(*tasks)))

0 commit comments

Comments
 (0)