Allow float for int argument type [pylint plugin] (#114105)
This commit is contained in:
parent
5c97049f2e
commit
3929273b41
4 changed files with 47 additions and 5 deletions
|
@ -2968,6 +2968,15 @@ def _is_valid_type(
|
|||
):
|
||||
return True
|
||||
|
||||
# Special case for int in argument type
|
||||
if (
|
||||
expected_type == "int"
|
||||
and not in_return
|
||||
and isinstance(node, nodes.Name)
|
||||
and node.name in ("float", "int")
|
||||
):
|
||||
return True
|
||||
|
||||
# Name occurs when a namespace is not used, eg. "HomeAssistant"
|
||||
if isinstance(node, nodes.Name) and node.name == expected_type:
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue