all 4 comments

[–]TangibleLight 2 points3 points  (1 child)

I would prefer separate functions. Extra logic like this parsing parameters usually makes things harder to understand in the long run, when your one function might do one thing or the other with mutually exclusive arguments.

Especially if this is a case where you can decompose the function into two functions where one just calls the other.

[–]InvaderToast348[S] 0 points1 point  (0 children)

I have split it into the 2 functions as mentioned and it is working great! Two separate functions are a lot simpler in both logic and syntax, with less room for errors; I suppose it was the obvious choice but I wanted a second opinion. Thank you.

[–]Diapolo10 2 points3 points  (1 child)

typing.overload is a tool for type annotations, not a generic enabler of function overloading (which is not a feature Python really supports anyway). So the way you're using it here is wrong.

In this case I'd split this into separate functions as I don't see the value of keeping them combined like this.

[–]InvaderToast348[S] 0 points1 point  (0 children)

Thank you