3 ms·
PEP 443 -- Single-dispatch generic functions
- adlpz 13y agoIt might be useful, but I find it will be overkill for most use cases where you can solve this with a simple if/else checking the type of the argument. At the end of the day this is just a weird syntactic sugar implemented through a standard-library decorator. But it's cool anyway because it's just there. Python, by design, will never have real function overloading so emulating it will look ugly.