Skip to content

Commit

Permalink
Avoid extra isinstance calls in _builtin_filter_predicate (pylint-dev…
Browse files Browse the repository at this point in the history
  • Loading branch information
correctmost authored Sep 6, 2024
1 parent 5982618 commit dc5dafb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions astroid/brain/brain_builtin_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def _builtin_filter_predicate(node, builtin_name) -> bool:
# Match = type(...)
# ```
return False
if isinstance(node.func, nodes.Name) and node.func.name == builtin_name:
return True
if isinstance(node.func, nodes.Name):
return node.func.name == builtin_name
if isinstance(node.func, nodes.Attribute):
return (
node.func.attrname == "fromkeys"
Expand Down

0 comments on commit dc5dafb

Please sign in to comment.