fix: include complex in std::complex input annotation - #6113
Conversation
The input annotation for `std::complex<T>` omitted the builtin `complex` type, which typeshed only makes a `typing.SupportsComplex` on Python 3.11+. Assisted-by: ClaudeCode:claude-opus-5 Claude-Session: https://claude.ai/code/session_013JABmnjt9oAh29p1pytAB3
Why the explicit
|
See #6112.
🤖 AI text below 🤖
Description
Fixes #6102
The
std::complex<T>caster declared its input annotation astyping.SupportsComplex | typing.SupportsFloat | typing.SupportsIndex, whichomits the builtin
complex. In typeshed,complexonly gets__complex__onPython 3.11+, so on Python 3.10 a strict type checker rejects passing a plain
complex literal, although the caster accepts it. The input annotation now starts
with
complex |, and the signature test was updated.Suggested changelog entry:
complextype in the input annotation of thestd::complex<T>type caster.https://claude.ai/code/session_013JABmnjt9oAh29p1pytAB3