Skip to content

Conversation

@sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Oct 14, 2025

Summary

If a function is decorated with a decorator that returns a union of Callables, also treat it as a union of function-like Callables.

Labeling as internal, since the previous change has not been released yet.

Test Plan

New regression test.

@sharkdp sharkdp requested a review from carljm as a code owner October 14, 2025 08:23
@sharkdp sharkdp added the internal An internal refactor or improvement label Oct 14, 2025
@sharkdp sharkdp added the ty Multi-file analysis & type inference label Oct 14, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@sharkdp sharkdp force-pushed the david/handle-unions-of-callables branch from 09ce42e to 413d686 Compare October 14, 2025 08:28
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

mypy_primer results

No ecosystem changes detected ✅
No memory usage changes detected ✅

@sharkdp sharkdp enabled auto-merge (squash) October 14, 2025 09:43
@sharkdp sharkdp merged commit ac2c530 into main Oct 14, 2025
40 checks passed
@sharkdp sharkdp deleted the david/handle-unions-of-callables branch October 14, 2025 09:47
dcreager added a commit that referenced this pull request Oct 14, 2025
…able

* dcreager/non-inferable-api:
  just the api parts
  [ty] Fix further issues in `super()` inference logic (#20843)
  [ty] Document when a rule was added (#20859)
  [ty] Treat `Callable` dunder members as bound method descriptors (#20860)
  [ty] Handle decorators which return unions of `Callable`s (#20858)
  Fix false negatives in `Truthiness::from_expr` for lambdas, generators, and f-strings (#20704)
  [ty] Rename Type unwrapping methods (#20857)
  Update `lint.flake8-type-checking.quoted-annotations` docs (#20765)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants