mirror of
https://github.com/semver/semver.git
synced 2026-07-11 04:52:47 -05:00
[GH-ISSUE #248] Change is potentially breaking- only breaks invalid usage. #7147
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Lucretiel on GitHub (Mar 18, 2015).
Original GitHub issue: https://github.com/semver/semver/issues/248
Let's say I have a function that wraps python's print:
This is version 1.0.0. If I extend the method with an additional kwarg, like so:
Would this necessitate a bump to 1.1.0 or 2.0.0? The added feature is pure extension- any correctly written code would be completely backwards compatible, because
printdoesn't expect athingkwarg. However, if someone had written this:This would result in
printraising aTypeErrorexception in 1.0.0, but it would invoke the newthingbehavior in the new version- technically, a breaking change. Does the fact that thisprint_wrapexample is incorrect usage mean that I can consider this a backwards compatible change? I couldn't find any clear guidance in the current semver release.@FichteFoll commented on GitHub (Mar 18, 2015):
Since a major increase is required for breaking changes to the public API, it raises the following core question: "What is the public API?"
So in your particular case it would probably be "Is the old behavior documented?" (likely it's not). An example for this would be "any other parameter will definitely raise TypeError" or similar.
Also, since you are technically adding a parameter to a function here you are not really breaking old functionality, you are adding some. It would basically be impossible to add anything to a module in a minor release because a user "could be accessing this particular attribute of the module and expect an AttributeError".
@PaulMag commented on GitHub (Sep 14, 2015):
I agree with FichteFoll that this is not considered a breaking change unless you have specifically stated in the public what should happen before.
""
It would basically be impossible to add anything to a module in a minor release because a user "could be accessing this particular attribute of the module and expect an AttributeError".
"""
Exactly. :)
@jwdonahue commented on GitHub (Dec 8, 2017):
@Lucretiel, it's clear you have back-compat, bump the minor version for the new feature.
If you have no further questions on this matter, please close this issue at your earliest possible convenience.