4 ms·
Yeah but as I said it can still go far more general than just int, float and complex. It could be any arbitrary class defined by somebody else that I could not
by clusmore 10y ago
Yeah but as I said it can still go far more general than just int, float and complex. It could be any arbitrary class defined by somebody else that I could not possibly know about at design time, and so a whitelisting approach of concrete classes is simply not going to cut it. It would be nice to have a way to describe the actual requirements (only that the elements support __add__ and __radd__).
- zardeh 10y agoWell, my joke was that numbers.Number exists, and I think supports those operations, but even someone complaining about this topic is unaware that it exists.