Skip to content

Fix *args/**kwargs return types. Add type hinting to py::make_tuple - #5881

Merged
rwgk merged 6 commits into
pybind:masterfrom
InvincibleRMC:type-make_tuple-fix--args/--kwargs-return-type
Nov 14, 2025
Merged

Fix *args/**kwargs return types. Add type hinting to py::make_tuple #5881
rwgk merged 6 commits into
pybind:masterfrom
InvincibleRMC:type-make_tuple-fix--args/--kwargs-return-type

Conversation

@InvincibleRMC

@InvincibleRMC InvincibleRMC commented Oct 26, 2025

Copy link
Copy Markdown
Contributor

Description

While working on #5879. I noticed the return type of py::args/py::kwargs was wrong.

Update the return type of py::args/py::kwargs. Also updated make_tuple to use typing::Tuple similar to how make_iterator uses typing::Iterator.

Suggested changelog entry:

* Fix `*args/**kwargs` return types. Add type hinting to `py::make_tuple`.

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
@rwgk

rwgk commented Nov 12, 2025

Copy link
Copy Markdown
Collaborator

@gentlegiantJGC Is there a chance that you could help formally reviewing (and approving) this PR?

@gentlegiantJGC gentlegiantJGC 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.

Looks good

@rwgk rwgk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @gentlegiantJGC for the review!

Thanks @InvincibleRMC for jumping in to fix this!

@rwgk

rwgk commented Nov 14, 2025

Copy link
Copy Markdown
Collaborator

Oh ... merge conflicts, @InvincibleRMC could you please resolve?

@InvincibleRMC

Copy link
Copy Markdown
Contributor Author

Oh ... merge conflicts, @InvincibleRMC could you please resolve?

should be good now

@rwgk
rwgk merged commit 42cda75 into pybind:master Nov 14, 2025
85 checks passed
@github-actions github-actions Bot added the needs changelog Possibly needs a changelog entry label Nov 14, 2025
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Jan 21, 2026
@yamatveev

Copy link
Copy Markdown
Contributor

FYI: https://gitlab.com/tango-controls/pytango/-/merge_requests/977

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants