Replies: 1 comment
-
Added in 23589d3 to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Opening this for comments on
@multimethod
vs@<name>.register
.This project pre-dates Python 3: type hints, mypy, and
functools.singledispatch
. At the time it seemed natural to register methods based on function name, which requires stack frame support to find a previously created multimethod. And there's strong precedence for it in languages with native multiple dispatch.singledispatch
has set a different precedent with explicitregister
methods on existing objects. Although this author doesn't particularly like using_
as a name, maybe conforming is more important now since it's established in the standard library.Another compelling reason is that mypy raises
already defined
errors that have to be suppressed through configuration when using@multimethod
.Beta Was this translation helpful? Give feedback.
All reactions