Skip to content

Commit b2e7926

Browse files
committed
Add type comments
1 parent 3d78d02 commit b2e7926

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

.github/scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ python -m pytest # Run the tests without IPython.
2424
pip install ipython
2525
python -m pytest # Now run the tests with IPython.
2626
pylint fire --ignore=test_components_py3.py,parser_fuzz_test.py,console
27-
if [[ ${PYTHON_VERSION} == 3.7 ]]; then
27+
if [[ ${PYTHON_VERSION} == 3.12 ]]; then
2828
# Run type-checking
2929
pip install uv
3030
uvx ty check --exclude fire/test_components_py3.py

fire/inspectutils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def Py3GetFullArgSpec(fn):
102102
# pylint: disable=no-member
103103
# pytype: disable=module-attr
104104
try:
105-
sig = inspect._signature_from_callable( # pylint: disable=protected-access
105+
sig = inspect._signature_from_callable( # pylint: disable=protected-access # type: ignore
106106
fn,
107107
skip_bound_arg=True,
108108
follow_wrapper_chains=True,
@@ -129,19 +129,19 @@ def Py3GetFullArgSpec(fn):
129129
name = param.name
130130

131131
# pylint: disable=protected-access
132-
if kind is inspect._POSITIONAL_ONLY:
132+
if kind is inspect._POSITIONAL_ONLY: # type: ignore
133133
args.append(name)
134-
elif kind is inspect._POSITIONAL_OR_KEYWORD:
134+
elif kind is inspect._POSITIONAL_OR_KEYWORD: # type: ignore
135135
args.append(name)
136136
if param.default is not param.empty:
137137
defaults += (param.default,)
138-
elif kind is inspect._VAR_POSITIONAL:
138+
elif kind is inspect._VAR_POSITIONAL: # type: ignore
139139
varargs = name
140-
elif kind is inspect._KEYWORD_ONLY:
140+
elif kind is inspect._KEYWORD_ONLY: # type: ignore
141141
kwonlyargs.append(name)
142142
if param.default is not param.empty:
143143
kwdefaults[name] = param.default
144-
elif kind is inspect._VAR_KEYWORD:
144+
elif kind is inspect._VAR_KEYWORD: # type: ignore
145145
varkw = name
146146
if param.annotation is not param.empty:
147147
annotations[name] = param.annotation
@@ -259,7 +259,7 @@ def Info(component):
259259
try:
260260
inspector = oinspect.Inspector(theme_name="neutral")
261261
except TypeError: # Only recent versions of IPython support theme_name.
262-
inspector = oinspect.Inspector()
262+
inspector = oinspect.Inspector() # type: ignore
263263
info = inspector.info(component)
264264

265265
# IPython's oinspect.Inspector.info may return '<no docstring>'

0 commit comments

Comments
 (0)