If you add the extra argument as an optional it will work nice much of the time.
def func1(a, b, extra = 5):
----func2(5, a+b, extra=extra)
Doctests are good documentation and easy to write (just copy and paste your console session), but its true its hard to exercise EVERY code path. You can also automatically create some doctests by doing using a createTest decorator i.e: f = createTest(f) for all f in user defined modules, but no guarantees.
As long as your not doing some complex polymorphism, pylinters can catch many although not all errors. I believe some of them use "Type Inference".
I wonder how do Smalltalk and Lisp solve this problem? Did they go the Erlang route and reload code on errors?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you add the extra argument as an optional it will work nice much of the time.
def func1(a, b, extra = 5):
----func2(5, a+b, extra=extra)
Doctests are good documentation and easy to write (just copy and paste your console session), but its true its hard to exercise EVERY code path. You can also automatically create some doctests by doing using a createTest decorator i.e: f = createTest(f) for all f in user defined modules, but no guarantees.
As long as your not doing some complex polymorphism, pylinters can catch many although not all errors. I believe some of them use "Type Inference".
I wonder how do Smalltalk and Lisp solve this problem? Did they go the Erlang route and reload code on errors?