3 ms·
Here's the problem: `a<b>c` is already valid python. `3<5>2` evaluates to true, because python allows operator overloading. Because the < and > operators can
by zardeh 12y ago
Here's the problem:
`a<b>c` is already valid python. `3<5>2` evaluates to true, because python allows operator overloading. Because the < and > operators can be overloaded, there is no guarantee that an object of type "class" will not have them (this would, I believe, require some metaclass hackery, but still).
So, given that `object<int>()` throws a type error in python and not a syntax error, you can't unambiguously parse that.
- dllthomas 12y agoYeah, that's for sure a problem. There are potential ways around it, but none of them great (that I see, at least). "So, given that `object<int>()` throws a type error in python and not a syntax error, you can't unambiguously parse that." Apparently in Python 2, it's not even an error.