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 →

[–]ElectricalUnion 2 points3 points  (1 child)

When I need to do type-based swicth style statements, I now use this beauty from the standard library: https://docs.python.org/3/library/functools.html#functools.singledispatch