You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What all the beartype-based solutions have in common is settling for a linear isinstance scan, sacrificing a fast lookup. Maybe dispatch speed is not important to users, or maybe multimethod should continue to offer speed as a distinguishing feature. There are already 3 choices which trade-off speed and flexibility - multimethod, multidispatch, and overload - so there are plenty of options.
Which trade-off of features and speed is preferred?
`multimethod` - fastest cached dispatch, positional only arguments
50%
`multidispatch` - slightly slower to support keyword arguments, using the first function's signature
50%
`overload` - slowest linear dispatch, with support for predicates
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It seems like there is renewed interest in multiple dispatch, particularly with robust support for generics.
What all the
beartype
-based solutions have in common is settling for a linearisinstance
scan, sacrificing a fast lookup. Maybe dispatch speed is not important to users, or maybemultimethod
should continue to offer speed as a distinguishing feature. There are already 3 choices which trade-off speed and flexibility -multimethod
,multidispatch
, andoverload
- so there are plenty of options.2 votes ·
Beta Was this translation helpful? Give feedback.
All reactions