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

Does version.parse still have a purpose? #679

Closed
MrMino opened this issue Feb 21, 2023 · 5 comments
Closed

Does version.parse still have a purpose? #679

MrMino opened this issue Feb 21, 2023 · 5 comments

Comments

@MrMino
Copy link
Contributor

MrMino commented Feb 21, 2023

Currently parse boils down to the following one-liner:

Version(version)

Is there still any future usecase for it, or is it just a leftover from LegacyVersion times that one can now avoid, and use Version directly instead? Are there any plans to deprecate it?

Docs do not specify whether one is preferred over another, but right now it seems like parse is just redundant function call overhead.

I understand the need to preserve parse in its current form for API stability, but it would be nice to indicate which one is future-proof / whether one can call Version(...) directly and not have to worry about any additions to the spec being implemented outside of it.

@MrMino
Copy link
Contributor Author

MrMino commented Feb 21, 2023

FWIW using Version directly also minimizes number of imports when using type hints 😉.

@pradyunsg
Copy link
Member

pradyunsg commented Feb 21, 2023

Calling Version directly is totally OK. I don't expect we'd be enforcing a change to that in any way.

@pradyunsg
Copy link
Member

Are there any plans to deprecate it?

No, because it has ~0 cost and consumers needing to change their calls is unnecessary churn IMO.

@MrMino
Copy link
Contributor Author

MrMino commented Feb 21, 2023

That's fine, but the docs are a bit ambiguous. Grice's maxims come into play here and if the docs give me two different ways of doing something, I automatically assume that they are not equivalent. This is probably the case for most humans :).

Would you be open to adding this to the parse docs?

This is the same as calling `Version(...)` directly.

@pradyunsg
Copy link
Member

#597 would likely involve covering this, so a PR making any level of progress toward that would be welcome!

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

No branches or pull requests

2 participants