3 ms·
All libraries extend their language with new features. A lot of the proposed value-add seems like the authors aren't aware the built-in `type()` can dynamicall
by LukeB42 6y ago
All libraries extend their language with new features.
A lot of the proposed value-add seems like the authors aren't aware the built-in `type()` can dynamically modify class definitions.
Getting rid of `hex(id(self))` in `__repr__` is regressive UX.
@typedispatch seems like both a slow way of using 'isinstance()' and a FOMO C++ virtual function bloat.
- qayxc 6y agoWhat does typed dispatch have to do with virtual functions in C++? This type of dispatch happens at compile-time in C++ and has nothing to do with "bloat" or even virtual functions.
- LukeB42 6y agoWhat's it offering that's more idiomatic than the `isinstance()` it breaks down to other than resembling virtual functions in C++? What's costlier, the new stack frames plus conditional for a decorator or the `elif isinstance()`s in one function definition? How does a programmer reference the correct function definition by name if they're using @typedispatch instead of `isinstance()`?
- qayxc 6y agoI get the feeling that you don't know what virtual functions in C++ are. I'd suggest you stop comparing typed dispatch to virtual functions in C++, because they have nothing in common. If you want to draw parallels, make sure to use a suitable analog.
- LukeB42 6y agoI'm thinking of templates, if that helps.