mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-25 19:40:29 -04:00
Enable --warn-redundant-casts
option in mypy (#14671)
* Enable `--warn-redundant-casts` option in mypy Doesn't do much but helps me sleep better at night. * Changelog * Fix name of the ignore * Fix one more missed cast Not sure why I didn't see this one locally, maybe I needed a poetry update * Remove old comment Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
This commit is contained in:
parent
7982891794
commit
3d87847ecc
5 changed files with 7 additions and 6 deletions
|
@ -667,7 +667,8 @@ class DatabasePool:
|
|||
)
|
||||
# also check variables referenced in func's closure
|
||||
if inspect.isfunction(func):
|
||||
f = cast(types.FunctionType, func)
|
||||
# Keep the cast for now---it helps PyCharm to understand what `func` is.
|
||||
f = cast(types.FunctionType, func) # type: ignore[redundant-cast]
|
||||
if f.__closure__:
|
||||
for i, cell in enumerate(f.__closure__):
|
||||
if inspect.isgenerator(cell.cell_contents):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue