You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've sometimes had occasion to want to modify a version, for instance, to add or remove a local or dev version component. It would be nice to have a replace method that creates a copy of a Version with the changes you want.
I'm happy to open a PR!
The text was updated successfully, but these errors were encountered:
Fixespypa#659
Let me know if something like this seems acceptable to you and I'll add
tests and documentation.
Some notes:
- My use case was adding a local version to an existing version
- I don't think it would make sense to allow replacing parts of the
release, e.g. "major", since I don't really see a use case. Things
like `v.replace(major=v.major+1)` are probably just mistakes.
- This is why I don't allow replacing `epoch` either
- `Version.__new__(Version)` is a little gross, as is the munging.
The munging is designed to line up with the corresponding properties,
so `v.replace(xyz=v.xyz)` always works.
I've sometimes had occasion to want to modify a version, for instance, to add or remove a local or dev version component. It would be nice to have a
replace
method that creates a copy of a Version with the changes you want.I'm happy to open a PR!
The text was updated successfully, but these errors were encountered: