Skip to content

gh-95065: PoC: Argument Clinic: Support multiple '* [from ...]' deprecations #107742

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

Closed

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Aug 7, 2023

This is a rough draft! Proof-of-concept only.

@erlend-aasland erlend-aasland changed the title gh-95065: Argument Clinic: Support multiple '* [from ...]' deprecations gh-95065: PoC: Argument Clinic: Support multiple '* [from ...]' deprecations Aug 7, 2023
@erlend-aasland
Copy link
Contributor Author

I'm not sure this feature improvement is worth it; though this is a rough draft, it introduces a lot more complexity. After this experiment, I'm aligned to say that we drop the ball on multiple layers of deprecation, for now. If the need arises, we can pick up this ball again (and try to implement this slightly nicer).

cc. @serhiy-storchaka, @AlexWaygood, @AA-Turner

@@ -5520,6 +5520,7 @@ test_deprecate_positional_pos1_len1_optional(PyObject *module, PyObject *const *
PyObject *a;
PyObject *b = Py_None;

// Emit compiler warnings when we get to Python 3.14.
Copy link
Member

@AlexWaygood AlexWaygood Aug 7, 2023

Choose a reason for hiding this comment

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

Whatever we decide w.r.t. the larger feature, the addition of these comments to the generated code seems like a nice enhancement by itself

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Can we think of any current or recent situations where a stdlib function is undergoing simultaneous deprecations for several parameters, with different removal dates for the different parameters? If this is isn't something that actually comes up that frequently, I'm inclined to say that the feature probably isn't worth the extra complexity.

@erlend-aasland
Copy link
Contributor Author

Taking sqlite3.connect as an example, I'd much rather do all deprecations in one go, rather than spreading it out over years and years with deprecation warnings.

Combining different kinds of deprecations (deprecated positional plus deprecated keyword) is another story, though, but that's OT for this PR.

@erlend-aasland
Copy link
Contributor Author

I'm abandoning this effort. There is no reason to follow this up unless there is a pressing need for it.

@erlend-aasland erlend-aasland deleted the ac-deprecate-multiple branch August 9, 2023 08:01
@serhiy-storchaka
Copy link
Member

I am currently working on / [from ...]. It requires some rewriting to support two different deprecation terms (I will simplify the current compiler warnings for this). But after merging it, it will be easier to add support of multiple * [from ...] later.

In any case this feature is not necessary. We can just defer the change and turn parameters to keyword-only on the same later term. Nobody died from prolonging the deprecation period (I hope so).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants