Skip to content

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

Merged
rwgk merged 6 commits intopybind: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 intopybind:masterfrom
InvincibleRMC:type-make_tuple-fix--args/--kwargs-return-type

Conversation

@InvincibleRMC
Copy link
Copy Markdown
Contributor

@InvincibleRMC InvincibleRMC commented Oct 26, 2025

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
Copy link
Copy Markdown
Collaborator

rwgk commented Nov 12, 2025

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

Copy link
Copy Markdown
Contributor

@gentlegiantJGC gentlegiantJGC left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Copy Markdown
Collaborator

@rwgk rwgk left a comment

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
Copy link
Copy Markdown
Collaborator

rwgk commented Nov 14, 2025

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