Skip to content

Conversation

@Tpt
Copy link
Contributor

@Tpt Tpt commented Aug 22, 2025

No description provided.

@Tpt Tpt marked this pull request as draft August 22, 2025 10:01
@Tpt Tpt changed the title fill PyTypeInfo::NAME with a Pythonic value fill PyTypeInfo::NAME with Pythonic values (e.g. BasedException) instead of C ones (e.g. PyBasedException) Aug 22, 2025
@Tpt Tpt force-pushed the tpt/name branch 5 times, most recently from 41a554c to a128e0b Compare August 22, 2025 16:16
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, overall makes the error messages look much better IMO and I guess gives us opportunities to clean other stuff up 🤞

@Tpt Tpt marked this pull request as ready for review August 25, 2025 14:58
@davidhewitt davidhewitt changed the title fill PyTypeInfo::NAME with Pythonic values (e.g. BasedException) instead of C ones (e.g. PyBasedException) fill PyTypeInfo::NAME with Pythonic values (e.g. BaseException) instead of C ones (e.g. PyBaseException) Aug 31, 2025
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 I think this looks great. A few questions / final adjustments.

I wonder if, for sake of not breaking users, we should consider deprecating NAME and just having FULLY_QUALIFIED_NAME, if we can make that work. Otherwise, I think we'd want to mention this in the migration guide.

@davidhewitt
Copy link
Member

With #5387 merging, I wonder, is the solution now to deprecate PyTypeInfo::NAME instead (and instead use the TypeHint struct from #5438)?

@Tpt
Copy link
Contributor Author

Tpt commented Sep 15, 2025

With #5387 merging, I wonder, is the solution now to deprecate PyTypeInfo::NAME instead (and instead use the TypeHint struct from #5438)?

Yes! I think this MR is still relevant: we will just concatenate the module name and the type name to generate the TypeHint struct (note that it will also require converting all module=Some("builtins") into module=None but it's not a big deal, the MODULE constant is not used anywhere in pyO3 outside of pyclasses)

@Tpt Tpt marked this pull request as draft October 8, 2025 16:54
@Tpt Tpt force-pushed the tpt/name branch 3 times, most recently from 349ecfd to 0a86c6f Compare October 23, 2025 09:28
@Tpt Tpt marked this pull request as ready for review October 23, 2025 13:18
@Tpt Tpt marked this pull request as draft October 24, 2025 05:10
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.

2 participants