Skip to content

types: clean up types macros#1592

Merged
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:tidy-types-macros
May 3, 2021
Merged

types: clean up types macros#1592
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:tidy-types-macros

Conversation

@davidhewitt
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants