Skip to content

Comments

Introspection: fix return type hint for Result<()>#5674

Merged
davidhewitt merged 5 commits intoPyO3:mainfrom
Tpt:tpt/inspect-none-tuple
Dec 12, 2025
Merged

Introspection: fix return type hint for Result<()>#5674
davidhewitt merged 5 commits intoPyO3:mainfrom
Tpt:tpt/inspect-none-tuple

Conversation

@Tpt
Copy link
Contributor

@Tpt Tpt commented Dec 3, 2025

Uses a hack to get const specialization working

Closes #5645

@Tpt Tpt force-pushed the tpt/inspect-none-tuple branch from 5d42a68 to 63af1e4 Compare December 4, 2025 07:49
@Tpt Tpt marked this pull request as ready for review December 4, 2025 08:12
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks, generally looks great! Couple of small comments.

Xref #4896

Comment on lines 26 to 30
pub const fn is_empty_tuple_from_closure<B: IsEmptyTuple>(
_closure_returning_bool: &impl FnOnce() -> B,
) -> bool {
B::VALUE
}
Copy link
Member

Choose a reason for hiding this comment

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

This is neat, it provides a way to lift type inference into compile time 🎉

Tpt and others added 5 commits December 12, 2025 14:42
Uses a hack to get const specialization working

Closes PyO3#5645
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
@Tpt Tpt force-pushed the tpt/inspect-none-tuple branch from e9eb750 to bcf82df Compare December 12, 2025 13:42
@davidhewitt davidhewitt added this pull request to the merge queue Dec 12, 2025
Merged via the queue into PyO3:main with commit 6c5d391 Dec 12, 2025
43 checks passed
@Tpt Tpt deleted the tpt/inspect-none-tuple branch December 12, 2025 15:26
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.

Return value hint for __init__ is wrong, should be None

2 participants