Improve multiple dispatch
See original GitHub issueCurrently, multiple dispatch using def
and case
is rather clunky. The suggestion is to replace
def some_func(x):
case x:
match _ is int:
do_stuff_for_int(x)
match _ is str:
do_stuff_for_str(x)
with
case def some_func:
match x is int:
do_stuff_for_int(x)
match x is str:
do_stuff_for_str(x)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Why Multiple Dispatch Is My Favorite Way To Program
Multiple dispatch is a way that we can apply function calls as properties of types. In other words, we can redefine the same...
Read more >Implementing Multiple Dispatch - C2 wiki
Does anyone know of an efficient implementation of MultipleDispatch, comparable to Smalltalk's InlineCaching of messages or C++'s vtbl mechanism?
Read more >Multiple dispatch - Wikipedia
Multiple dispatch routes the dynamic dispatch to the implementing function or method using the combined characteristics of one or more arguments.
Read more >A polyglot's guide to multiple dispatch - Eli Bendersky's website
This is the first article in a series dedicated to multiple dispatch - an advanced abstraction technique available to programmers ...
Read more >Multiple Dispatch - Matthew Rocklin
Multiple dispatch separates interaction code from core code. This opens and democratizes interaction, for better or for worse.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Interesting idea—I’ll definitely look into that and see what I can do.
Awesome!