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

fix deprecation warning for trailing optional on #[setter] functions #4304

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

davidhewitt
Copy link
Member

Fixes #4292

Basically just don't emit the warning for setter or getter functions, and adds a test.

@@ -228,6 +228,18 @@ impl FnType {
}
}

pub fn signature_attribute_allowed(&self) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be helpful for future us to add a comment explaining why (getter/setter/classattr have fixed signatures with a single arg where Option<> has a specific meaning)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, added one, WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks

@davidhewitt davidhewitt added this pull request to the merge queue Jul 4, 2024
Merged via the queue into PyO3:main with commit 0af0227 Jul 4, 2024
41 checks passed
@davidhewitt davidhewitt deleted the setter-optional branch July 4, 2024 10:54
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.

'Deprecation of implicit default for trailing optional arguments' Causing issues with erasable setters
2 participants