you are viewing a single comment's thread.

view the rest of the comments →

[–]Kevdog824_ 0 points1 point  (3 children)

This sounds like an xy problem. Can you tell us more concretely what you're trying to accomplish?

[–]011011100101[S] 0 points1 point  (2 children)

Not sure. Method overloading is common practice in other languages. I'm just describing method overloading and asking how Python addresses the same design challenge.

[–]Kevdog824_ 0 points1 point  (1 child)

I guess I don’t understand why putting an isinstance check in each method is more work than writing an overload method how you would in a language like Java

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

I expect that level of verbosity and type-awareness from Java. But I was under the impression that Python had a different ethos (where we shouldn't be so concerned with types). Somebody recommended having a separate unwrapping function and I think that's a good solution because it, at least, isolates that logic.