Hacker News new | past | comments | ask | show | jobs | submit login

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.




Yeah, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: