Skip to content

Comments

[ty] Repurpose FunctionType.into_bound_method_type to return BoundMethodType#19793

Merged
carljm merged 4 commits intoastral-sh:mainfrom
MatthewMckee4:into-callable-option
Aug 6, 2025
Merged

[ty] Repurpose FunctionType.into_bound_method_type to return BoundMethodType#19793
carljm merged 4 commits intoastral-sh:mainfrom
MatthewMckee4:into-callable-option

Conversation

@MatthewMckee4
Copy link
Contributor

@MatthewMckee4 MatthewMckee4 commented Aug 6, 2025

Summary

As per our naming scheme (at least for callable types) this should return a BoundMethodType, or be renamed, but it makes more sense to change the return type.

I also ensure ClassType.into_callable returns a Type::Callable in the changed branch.

Ideally we could return a CallableType from these into_callable functions (and rename to into_callable_type but because of unions we cannot do this.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label Aug 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

mypy_primer results

No ecosystem changes detected ✅
No memory usage changes detected ✅

@MatthewMckee4
Copy link
Contributor Author

Oh i didn't think that would have any effect

@MatthewMckee4 MatthewMckee4 reopened this Aug 6, 2025
@MatthewMckee4 MatthewMckee4 changed the title Remove FunctionType.into_bound_method_type [ty] Repurpose FunctionType.into_bound_method_type to return BoundMethodType Aug 6, 2025
@carljm carljm merged commit ef1802b into astral-sh:main Aug 6, 2025
38 checks passed
dcreager added a commit that referenced this pull request Aug 7, 2025
* origin/main:
  [ty] Implemented support for "rename" language server feature (#19551)
  [ty] Reduce size of member table (#19572)
  [ty] Move server capabilities creation (#19798)
  [ty] Repurpose `FunctionType.into_bound_method_type` to return `BoundMethodType` (#19793)
  [ty] Validate writes to `TypedDict` keys (#19782)
  [ty] Add support for using the test command emitted when a mdtest fails (#19794)
dcreager added a commit that referenced this pull request Aug 7, 2025
* dcreager/bound-typevar: (24 commits)
  more comment fix
  this isn't true anymore
  fix inner function in overload implementation ecosystem error
  Update Rust toolchain to 1.89 (#19807)
  [ty] Add `ty.inlayHints.variableTypes` server option (#19780)
  synthetic typevars for type materializations are bound
  [ty] Add failing tests for tuple subclasses (#19803)
  [ty] Add `ty.experimental.rename` server setting (#19800)
  clippy
  make BoundTypeVarInstance interned
  [ty] Implemented support for "rename" language server feature (#19551)
  [ty] Reduce size of member table (#19572)
  [ty] Move server capabilities creation (#19798)
  separate types!
  tmp
  allow KnownInstance::TypeVar in type expressions
  bind typevar in Generic/Protocol base class reference
  [ty] Repurpose `FunctionType.into_bound_method_type` to return `BoundMethodType` (#19793)
  remove unneeded GenericContext::with_binding_context
  create KnownInstanceType::TypeVar for PEP 695 too
  ...
@MatthewMckee4 MatthewMckee4 deleted the into-callable-option branch November 6, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants