News for hackers. Stuff that matters.
Re:Implementing Function Overloading in Python by zomglings on Thursday March 26, 2020 @12:24PM (#22695189)
You will, the type could be Union[int, float].

Alternatively, you could also use the abstract base classes in the numbers module - https://docs.python.org/3/library/numbers.html

numbers.Number may be a good choice.

Still, you are right, overloading like this may be okay as a thought exercise, but would raise some serious questions during a code review. :)

There are no comments on this comment yet.