ruff/crates/red_knot_python_semantic/resources/mdtest/binary
Douglas Creager 23ccb52fa6
[red-knot] Handle unions of callables better (#16716)
This cleans up how we handle calling unions of types. #16568 adding a
three-level structure for callable signatures (`Signatures`,
`CallableSignature`, and `Signature`) to handle unions and overloads.

This PR updates the bindings side to mimic that structure. What used to
be called `CallOutcome` is now `Bindings`, and represents the result of
binding actual arguments against a possible union of callables.
`CallableBinding` is the result of binding a single, possibly
overloaded, callable type. `Binding` is the result of binding a single
overload.

While we're here, this also cleans up `CallError` greatly. It was
previously extracting error information from the bindings and storing it
in the error result. It is now a simple enum, carrying no data, that's
used as a status code to talk about whether the overall binding was
successful or not. We are now more consistent about walking the binding
itself to get detailed information about _how_ the binding was
unsucessful.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Carl Meyer <carl@astral.sh>
2025-03-17 10:35:52 -04:00
..
booleans.md [red-knot] add special case for float/complex (#16166) 2025-02-14 12:24:10 -08:00
classes.md Don't special-case class instances in binary expression inference (#15161) 2025-01-06 13:50:20 -05:00
custom.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
instances.md [red-knot] Handle unions of callables better (#16716) 2025-03-17 10:35:52 -04:00
integers.md [red-knot] Attribute access and the descriptor protocol (#16416) 2025-03-07 22:03:28 +01:00
tuples.md [red-knot] fix: improve type inference for binary ops on tuples (#16725) 2025-03-14 12:29:57 +01:00
unions.md [red-knot] Binary operator inference for union types (#16601) 2025-03-12 08:21:54 +01:00