About 2,000,000 results
Open links in new tab
  1. How do I use method overloading in Python? - Stack Overflow

    Apr 18, 2012 · Python 3.x includes standard typing library which allows for method overloading with the use of @overload decorator. Unfortunately, this is to make the code more readable, as the …

  2. class - Python function overloading - Stack Overflow

    Jan 1, 2016 · 132 Python does support "method overloading" as you present it. In fact, what you just describe is trivial to implement in Python, in so many different ways, but I would go with:

  3. 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...

  4. How to override the [] operator in Python? - Stack Overflow

    Dec 24, 2009 · What is the name of the method to override the [] operator (subscript notation) for a class in Python?

  5. python - How to overload __init__ method based on argument type ...

    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 the type by looking …

  6. Comprehensive guide to Operator Overloading in Python

    56 Python's operator overloading is done by redefining certain special methods in any class. This is explained in the Python language reference. For example, to overload the addition operator:

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

    Dec 1, 2022 · There's no overloading in Python. You could fiddle something together with decorators but in general: if you learn a new language use it as it is intended to use.

  8. python - Overloading Addition, Subtraction, and Multiplication ...

    How do you go about overloading the addition, subtraction, and multiplication operator so we can add, subtract, and multiply two vectors of different or identical sizes? For example, if the vectors...

  9. 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.

  10. Is it possible to overload Python assignment? - Stack Overflow

    Jun 14, 2012 · 101 The way you describe it is absolutely not possible. Assignment to a name is a fundamental feature of Python and no hooks have been provided to change its behavior. However, …