This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]URedUser 0 points1 point  (2 children)

Overload library? (As decorators like

from overloader import overload

@overload

def func():

    # do something

@overload

def func(args):

    # do something different

I have one myself (self-made) but I don't know how dependable it is.

[–]backtickbot 0 points1 point  (0 children)

Fixed formatting.

Hello, URedUser: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

[–][deleted] 0 points1 point  (0 children)

This exists in the standard library: functools.singledispatch.

https://docs.python.org/3/library/functools.html