Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: clean up types macros #1592

Merged
merged 1 commit into from May 3, 2021
Merged

Conversation

davidhewitt
Copy link
Member

Related to #1591, #1588.

I've been looking at the types macros just now, which are getting a bit more complicated again (especially if we customize Deref implementations to model base types as per #1588).

This PR makes two simplifications:

  • optional arguments to the macros (checkfunction, module, soon-to-be deref) have an explicit syntax #checkfunction=... so that the macros can parse unambiguously.
  • I've removed pyobject_native_var_type! - just use pyobject_native_type_core! if the layout is not suitable for inheriting, and pyobject_native_type! if the layout is suitable for inheriting.

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

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

Looks great!

@davidhewitt davidhewitt merged commit 20e10b3 into PyO3:main May 3, 2021
@davidhewitt davidhewitt deleted the tidy-types-macros branch May 3, 2021 16:36
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.

None yet

2 participants