Skip to content

Commit

Permalink
Annotate type on abstract/_function_base.py, and also correct some ty…
Browse files Browse the repository at this point in the history
…pes on _base.py and _classes.py that were incorrect.

Also remove the actual return statement from `SignedFunction._check_paramspec_args` as there was only a single place being called, and the return was not being used.

PiperOrigin-RevId: 688604582
  • Loading branch information
h-joo authored and copybara-github committed Oct 23, 2024
1 parent 83540a6 commit 98c3cc8
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 80 deletions.
5 changes: 4 additions & 1 deletion pytype/abstract/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ def property_get(
return self

def get_special_attribute(
self, unused_node: "cfg.CFGNode", name: str, unused_valself: "cfg.Binding"
self,
unused_node: "cfg.CFGNode",
name: str,
unused_valself: "cfg.Variable",
) -> "cfg.Variable | None":
"""Fetch a special attribute (e.g., __get__, __iter__)."""
if name == "__class__":
Expand Down
2 changes: 1 addition & 1 deletion pytype/abstract/_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ def getitem_slot(
)

def get_special_attribute(
self, node: cfg.CFGNode, name: str, valself: cfg.Binding
self, node: cfg.CFGNode, name: str, valself: cfg.Variable
) -> cfg.Variable | None:
if (
valself
Expand Down
Loading

0 comments on commit 98c3cc8

Please sign in to comment.