MCPcopy Index your code
hub / github.com/python/mypy / ArgSig

Class ArgSig

mypy/stubdoc.py:36–72  ·  view source on GitHub ↗

Signature info for a single argument.

Source from the content-addressed store, hash-verified

34
35
36class ArgSig:
37 """Signature info for a single argument."""
38
39 def __init__(
40 self,
41 name: str,
42 type: str | None = None,
43 *,
44 default: bool = False,
45 default_value: str = "...",
46 ) -> None:
47 self.name = name
48 self.type = type
49 # Does this argument have a default value?
50 self.default = default
51 self.default_value = default_value
52
53 def is_star_arg(self) -> bool:
54 return self.name.startswith("*") and not self.name.startswith("**")
55
56 def is_star_kwarg(self) -> bool:
57 return self.name.startswith("**")
58
59 def __repr__(self) -> str:
60 return "ArgSig(name={}, type={}, default={})".format(
61 repr(self.name), repr(self.type), repr(self.default)
62 )
63
64 def __eq__(self, other: Any) -> bool:
65 if isinstance(other, ArgSig):
66 return (
67 self.name == other.name
68 and self.type == other.type
69 and self.default == other.default
70 and self.default_value == other.default_value
71 )
72 return False
73
74
75class FunctionSig(NamedTuple):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…