refactor: self-referential type annotations for self-referential ContinuedFraction
methods
#41
Labels
refactor
Refactoring changes
ContinuedFraction
methods
#41
ATM the type annotations for
ContinuedFraction
class or instance methods that actually returnContinuedFraction
objects are incorrect - the current return type for these isfractions.Fraction
, whereas in fact they should beContinuedFraction
. To enable this a future statement is required for type annotations:This is also a problem for the
ContinuedFraction.validate
class method and theContinuedFraction.__init__
method, which need to be amended to accept valid input combinations involvingContinuedFraction
objects.The methods that need to be fixed are:
ContinuedFraction.validate
ContinuedFraction.__new__
ContinuedFraction.from_elements
ContinuedFraction.__init__
__add__
,__radd__
,__sub__
,__rsub__
, etc.Examples in docstrings and the documentation should be updated.
The text was updated successfully, but these errors were encountered: