3 ms·
Running `__radd__(tyepof(b) b)` on `a` seems like a complicated problem. So: Many LoC? Or, the generic, useless but correct, answer: it depends (as the linked
by a3w 3y ago
Running `__radd__(tyepof(b) b)` on `a` seems like a complicated problem. So: Many LoC?
Or, the generic, useless but correct, answer: it depends (as the linked article said, too)
- varjag 3y agoIt shoud've been possible to establish the lower and upper bounds.
- baq 3y agoit's about as possible as solving the halting problem if you allow for operator overloading.
- varjag 3y agoLeaving aside the apparent confusion between C and C++, do you really imply overloading could make adding two fixed size numbers in Python take unbounded time?
- baq 3y agoI'm saying a + b in Python can do whatever you override the __add__/__radd__ to. Not sure why you invoke C/C++ here. If you only limit yourself to numbers (the title doesn't specify that) it should be bounded, but the article goes into some depth here, so I'll leave it at that.
- varjag 3y agoFair!
- FartyMcFarter 3y agoBut this has nothing to do with the halting problem. You can run the code, you don't need to do this theoretically.
- FartyMcFarter 3y agoNo. All you need to do is use a code coverage tool to find out which lines are run.