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
DesignIdeas, suggestions, musings about design questionsEnhancementNot a bug, but increases or improves in value, quality, desirability, or attractivenessQuestionUnclear or open issue subject for debateRelease_3.x.yOnly for the major release 3
Currently, our code catches an invalid version and raise an exception. This is good. However, the exceptions are usually builtin exceptions like TypeError, ValueError, or AttributeError.
This could make it likely, that an semver exceptions are "hidden". It cannot explicitly be checked that a TypeError is coming from semver and not from another, unrelated third party library.
Proposal
This part could be solved by introducing our own hierarchy of exceptions like so:
classInvalidVersionError(ValueError):
"""Raised by invalid parts in a semver version"""
The nice thing about this approach is, any old code would still work (as InvalidVersionError is derived from ValueError).
DesignIdeas, suggestions, musings about design questionsEnhancementNot a bug, but increases or improves in value, quality, desirability, or attractivenessQuestionUnclear or open issue subject for debateRelease_3.x.yOnly for the major release 3
Activity