4 ms·
Python 3 – Function Overloading with singledispatch
- dalke 11y ago@add.register(int) def _(a, b): print("First argument is of type ", type(a)) Is that the preferred style? Won't '_' makes it hard for syntax-based tools like an IDE to implement features like "go to function"? I know in my case I do C-S or grep "def abc" to find a function starting with "abc". That seems much more difficult if '_' becomes the standard name for this case.
- driscollis 11y agoIt seems to be. That's what I found in the official documentation anyway