Skip to content

fix support inspect unwrap to return precise type #3696 - #3901

Closed
asukaminato0721 wants to merge 4 commits into
meta:mainfrom
asukaminato0721:3696
Closed

asukaminato0721 wants to merge 4 commits into
meta:mainfrom
asukaminato0721:3696

Conversation

@asukaminato0721

@asukaminato0721 asukaminato0721 commented Jun 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3696

functools._Wrapped.__wrapped__ now preserves the exact wrapped object type, so nested @wraps chains remain visible

Decorator application no longer collapses functools._Wrapped back to the wrapper signature

inspect.unwrap now follows .__wrapped__ until the end of the chain when stop is omitted or None

Test Plan

add test

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot added size/l and removed size/l labels Jun 23, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@meta-codesync

meta-codesync Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D115288097. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@stroxler stroxler left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I think there are a few correctness issues we need to clear up before we can merge this (plus it has a merge conflict)

  1. Unknown wrapping state becomes falsely precise — [call.rs:3035–3036](

    if !self.has_attr(&ty, &wrapped_attr) {
    return Some(ty);
    ).
    A Callable[[], int] can wrap a function returning str, but unwrap now reports int when the annotation hides __wrapped__. Ignoring an in-place update_wrapper result produces the same problem. Preserve a conservative fallback when wrapping state is unknown.

  2. Mixed unions stop unwrapping prematurely — [call.rs:3035–3036](

    if !self.has_attr(&ty, &wrapped_attr) {
    return Some(ty);
    ).
    One member without __wrapped__ stops traversal for the entire union. A reproduced case reports int, although runtime can return str. Traverse each branch independently.

  3. Starred arguments take the wrong inference path — [call.rs:3018–3029](

    if x.arguments.args.len() != 1 {
    return None;
    }
    if !x.arguments.keywords.iter().all(|kw| {
    kw.arg.as_ref().is_some_and(|id| id.as_str() == "stop")
    && matches!(kw.value, Expr::NoneLiteral(_))
    }) {
    return None;
    }
    let wrapped_attr = Name::new_static("__wrapped__");
    let mut ty = self.expr_infer(&x.arguments.args[0], errors);
    ).
    Valid unwrap(*(f,)) now produces a spurious not-a-type error. Reject starred arguments in the specialization and use normal call solving.

@github-actions

Copy link
Copy Markdown

Diff from mypy_primer, showing the effect of this PR on open source code:

============================================================
SUMMARY
============================================================
Total: +54 new errors, -73 fixed errors
By preset: +0/-46 (default), +0/-46 (strict)

Projects with changes (17):
  tornado: +0 -1
  openlibrary: +7 -6
  rotki: +0 -1
  pytest: +0 -2
  jax: +0 -1
  scikit-learn: +0 -3
  manticore: +38 -38
  ibis: +1 -1
  hydpy: +3 -3
  trio: +1 -1
  sphinx: +0 -1
  dd-trace-py: +0 -6
  xarray: +0 -4
  kornia: +1 -1
  scrapy: +1 -1
  docstring-adder: +0 -1
  discord.py: +2 -2
============================================================

FULL DIFF DETAILS
------------------------------------------------------------

tornado (https://github.com/tornadoweb/tornado)
- ERROR tornado/gen.py:275:5-24: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]

openlibrary (https://github.com/internetarchive/openlibrary)
- ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:275:24-61: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:275:24-61: The type of `_gather_nearby_books` is unknown; it is inferred as an implicit `Any` [unknown-variable-type]
+ ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:275:50-61: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:288:20-86: The type of `docs` is unknown because it comes from an error [unknown-from-error]
+ ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:288:20-86: The type of `docs` is unknown; it is inferred as an implicit `Any` [unknown-variable-type]
- ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:301:20-86: The type of `docs` is unknown because it comes from an error [unknown-from-error]
+ ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:301:20-86: The type of `docs` is unknown; it is inferred as an implicit `Any` [unknown-variable-type]
- ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:313:20-86: The type of `docs` is unknown because it comes from an error [unknown-from-error]
+ ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:313:20-86: The type of `docs` is unknown; it is inferred as an implicit `Any` [unknown-variable-type]
- ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:333:20-87: The type of `docs` is unknown because it comes from an error [unknown-from-error]
+ ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:333:20-87: The type of `docs` is unknown; it is inferred as an implicit `Any` [unknown-variable-type]
- ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:335:35-39: The type of `d` is unknown because it comes from an error [unknown-from-error]
+ ERROR openlibrary/plugins/openlibrary/tests/test_partials.py:335:30-31: The type of `d` is unknown; it is inferred as an implicit `Any` [unknown-variable-type]

rotki (https://github.com/rotki/rotki)
- ERROR rotkehlchen/api/v1/parser.py:77:13-32: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]

pytest (https://github.com/pytest-dev/pytest)
- ERROR src/_pytest/compat.py:223:26-29: The type of this argument is unknown [unknown-argument-type]
- ERROR src/_pytest/doctest.py:531:46-49: The type of this argument is unknown [unknown-argument-type]

jax (https://github.com/google/jax)
- ERROR jax/_src/api_util.py:703:24-27: The type of this argument is partially unknown; it contains an implicit `Any` [partially-unknown-type]

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- ERROR sklearn/utils/deprecation.py:99:9-28: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
- ERROR sklearn/utils/tests/test_parallel.py:46:46-49: The type of this argument is partially unknown; it contains an implicit `Any` [partially-unknown-type]
- ERROR sklearn/utils/tests/test_parallel.py:195:42-85: The type of this argument is partially unknown; it contains an implicit `Any` [partially-unknown-type]

manticore (https://github.com/trailofbits/manticore)
- ERROR manticore/native/cpu/aarch64.py:1696:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:1696:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:1724:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:1724:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:1858:9-28: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:1858:17-28: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:1892:9-28: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:1892:17-28: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:1973:9-28: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:1973:17-28: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2249:9-30: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2249:19-30: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2279:9-30: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2279:19-30: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2391:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2391:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2424:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2424:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2459:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2459:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2521:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2521:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2554:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2554:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2589:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2589:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2684:9-30: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2684:19-30: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:2720:9-30: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:2720:19-30: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3366:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3366:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3394:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3394:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3477:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3477:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3505:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3505:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3623:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3623:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3663:17-36: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
- ERROR manticore/native/cpu/aarch64.py:3669:17-36: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3663:25-36: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
+ ERROR manticore/native/cpu/aarch64.py:3669:25-36: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3679:17-37: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
- ERROR manticore/native/cpu/aarch64.py:3685:17-37: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3679:26-37: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3691:17-36: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3685:26-37: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
+ ERROR manticore/native/cpu/aarch64.py:3691:25-36: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3927:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3927:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:3964:9-28: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:3964:17-28: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:4262:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:4262:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:4349:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:4349:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:4734:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:4734:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:4764:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:4764:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:4794:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:4794:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:4891:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:4891:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:4925:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:4925:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:4979:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:4979:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:5059:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:5059:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:5213:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:5213:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]
- ERROR manticore/native/cpu/aarch64.py:5243:9-29: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
+ ERROR manticore/native/cpu/aarch64.py:5243:18-29: The type of attribute `__wrapped__` is unknown; it is inferred as an implicit `Any` [unknown-attribute-access]

ibis (https://github.com/ibis-project/ibis)
- ERROR ibis/common/dispatch.py:103:9-53: Result of call expression is of type `_Wrapped[Unknown, Unknown, [*args: Unknown, **kwargs: Unknown], Unknown]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR ibis/common/dispatch.py:103:9-53: Result of call expression is of type `(*args: Unknown, **kwargs: Unknown) -> Unknown` and is not used; assign to `_` if this is intentional [unused-call-result]

hydpy (https://github.com/hydpy-dev/hydpy)
- ERROR hydpy/core/netcdftools.py:2901:5-63: Result of call expression is of type `_Wrapped[P_, None, P_, None]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR hydpy/core/netcdftools.py:2901:5-63: Result of call expression is of type `(ParamSpec(P_)) -> None` and is not used; assign to `_` if this is intentional [unused-call-result]
- ERROR hydpy/core/netcdftools.py:2918:5-63: Result of call expression is of type `_Wrapped[P_, None, P_, None]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR hydpy/core/netcdftools.py:2918:5-63: Result of call expression is of type `(ParamSpec(P_)) -> None` and is not used; assign to `_` if this is intentional [unused-call-result]
- ERROR hydpy/cythons/modelutils.py:471:5-47: Result of call expression is of type `_Wrapped[[PyxWriter], Iterator[str], [self: PyxWriter, lines: PyxPxdLines], None]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR hydpy/cythons/modelutils.py:471:5-47: Result of call expression is of type `(self: PyxWriter, lines: PyxPxdLines) -> None` and is not used; assign to `_` if this is intentional [unused-call-result]

trio (https://github.com/python-trio/trio)
- ERROR src/trio/_path.py:50:9-41: Result of call expression is of type `_Wrapped[..., object, P, Coroutine[Unknown, Unknown, T]]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR src/trio/_path.py:50:9-41: Result of call expression is of type `(ParamSpec(P)) -> Coroutine[Unknown, Unknown, T]` and is not used; assign to `_` if this is intentional [unused-call-result]

sphinx (https://github.com/sphinx-doc/sphinx)
- ERROR sphinx/util/inspect.py:84:31-34: The type of this argument is an explicit `Any` [explicit-any-use]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ERROR ddtrace/_trace/tracer.py:1048:50-51: The type of this argument is partially unknown; it contains an implicit `Any` [partially-unknown-type]
- ERROR ddtrace/contrib/internal/django/patch.py:273:55-59: The type of this argument is partially unknown; it contains an implicit `Any` [partially-unknown-type]
- ERROR ddtrace/contrib/internal/flask/patch.py:507:63-72: The type of this argument is unknown [unknown-argument-type]
- ERROR ddtrace/contrib/internal/flask/patch.py:534:59-63: The type of this argument is unknown [unknown-argument-type]
- ERROR ddtrace/contrib/internal/starlette/patch.py:96:63-70: The type of this argument is unknown because it comes from an error [unknown-from-error]
- ERROR ddtrace/internal/ci_visibility/utils.py:94:31-49: The type of this argument is unknown [unknown-argument-type]

xarray (https://github.com/pydata/xarray)
- ERROR doc/conf.py:407:51-54: Argument `ModuleType | Any` is not assignable to parameter `func` with type `(...) -> Any` in function `inspect.unwrap` [bad-argument-type]
- ERROR xarray/plot/dataarray_plot.py:1114:9-32: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
- ERROR xarray/plot/dataarray_plot.py:1847:9-32: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]
- ERROR xarray/plot/dataset_plot.py:321:9-32: Object of class `FunctionType` has no attribute `__wrapped__` [missing-attribute]

kornia (https://github.com/kornia/kornia)
- ERROR kornia/core/_compat.py:296:17-45: Result of call expression is of type `Overloaded[_Wrapped[[o: object, /], None, [self: Any, *args: Any, **kwargs: Any], None], _Wrapped[[name: str, bases: tuple[type[Any], ...], dict: dict[str, Any], /, **kwds: Any], None, [self: Any, *args: Any, **kwargs: Any], None]]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR kornia/core/_compat.py:296:17-45: Result of call expression is of type `(self: Any, *args: Any, **kwargs: Any) -> None` and is not used; assign to `_` if this is intentional [unused-call-result]

scrapy (https://github.com/scrapy/scrapy)
- ERROR scrapy/commands/parse.py:377:13-51: Result of call expression is of type `_Wrapped[Concatenate[Response, ...], Any, [response: Response, **cb_kwargs: Any], Deferred[list[Any]]]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR scrapy/commands/parse.py:377:13-51: Result of call expression is of type `(response: Response, **cb_kwargs: Any) -> Deferred[list[Any]]` and is not used; assign to `_` if this is intentional [unused-call-result]

docstring-adder (https://github.com/astral-sh/docstring-adder)
- ERROR add_docstrings.py:1141:13-69: The type of this argument is an explicit `Any` [explicit-any-use]

discord.py (https://github.com/Rapptz/discord.py)
- ERROR discord/ext/commands/help.py:307:9-73: Result of call expression is of type `_Wrapped[[], list[Command[Cog, ..., Any]], [*, _original: () -> list[Command[Any, ..., Any]] = ...], list[Command[Any, ..., Any]]]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR discord/ext/commands/help.py:307:9-73: Result of call expression is of type `(*, _original: () -> list[Command[Any, ..., Any]] = ...) -> list[Command[Any, ..., Any]]` and is not used; assign to `_` if this is intentional [unused-call-result]
- ERROR discord/ext/commands/help.py:308:9-75: Result of call expression is of type `_Wrapped[[], Generator[Command[Cog, ..., Any]], [*, _original: () -> Generator[Command[Any, ..., Any]] = ...], Generator[Command[Any, ..., Any] | Self@_HelpCommandImpl, Unknown]]` and is not used; assign to `_` if this is intentional [unused-call-result]
+ ERROR discord/ext/commands/help.py:308:9-75: Result of call expression is of type `(*, _original: () -> Generator[Command[Any, ..., Any]] = ...) -> Generator[Command[Any, ..., Any] | Self@_HelpCommandImpl, Unknown]` and is not used; assign to `_` if this is intentional [unused-call-result]

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync

meta-codesync Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 62ab2c5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support inspect unwrap to return precise type

3 participants