About 56,900 results
Open links in new tab
  1. Overloaded functions in Python - Stack Overflow

    Is it possible to have overloaded functions in Python? In C# I would do something like: void myfunction (int first, string second) { // Some code } void myfunction (int first, string second, f...

  2. How do I use method overloading in Python? - Stack Overflow

    Apr 18, 2012 · 192 It's method overloading, not method overriding. And in Python, you historically do it all in one function:

  3. class - Python function overloading - Stack Overflow

    Jan 1, 2016 · The act of creating such alternative functions for compile-time selection is usually referred to as overloading a function. (Wikipedia) Python is a dynamically typed language, so …

  4. Decorator for overloading in Python - Stack Overflow

    Dec 28, 2011 · So the logical way to implement overloading in Python is to implement a wrapper that uses both the declared name and the parameter types to resolve the function.

  5. Method overloading for different argument type in python

    Aug 17, 2014 · The overloading syntax you are looking for can be achieved using Guido van Rossum's multimethod decorator. Here is a variant of the multimethod decorator which can …

  6. How to do function overloading in Python? - Stack Overflow

    Dec 1, 2022 · I want to implement function overloading in Python. I know by default Python does not support overloading. That is what I am asking this question. I have the following code: def …

  7. python - How to overload __init__ method based on argument …

    I want to be able to initialize the class with, for example, a filename (which contains data to initialize the list) or with an actual list. What's your technique for doing this? Do you just check …

  8. Python function overloading recommended approach

    python function oop type-hinting constructor-overloading edited Jun 7, 2022 at 15:35 mkrieger1 24.2k 7 68 84

  9. python - What is a clean "pythonic" way to implement multiple ...

    Typically we expect function overloading to seperate out the logic for different ways of initializing something into totally independent functions. Here, we mixed everything into a single function, …

  10. Python: Can subclasses overload inherited methods? - Stack …

    Mar 8, 2010 · Python: Can subclasses overload inherited methods? Asked 15 years, 9 months ago Modified 15 years, 9 months ago Viewed 19k times