On Wed, Aug 25, 2010 at 12:19 PM, Stefan Behnel <[email protected]> wrote: > Robert Bradshaw, 25.08.2010 19:10: >> On Tue, Aug 24, 2010 at 10:30 PM, Stefan Behnel wrote: >>> Robert Bradshaw, 24.08.2010 17:14: >>>> On Tue, Aug 24, 2010 at 7:52 AM, Stefan Behnel wrote: >>>>> Haoyu Bai, 24.08.2010 16:11: >>>>>> Looking into Python's test suite, one potential issue is Python >>>>>> recognize ". .." as syntax error while my implementation will still >>>>>> accept it as Ellipsis. Could we tolerate this kind of divergent? >>>>> >>>>> IMHO, no. If Python rejects it and it's not Cython specific syntax, we >>>>> should reject it as well. (also, when compiling .py files, any non-Python >>>>> syntax should be rejected) >>>> >>>> Python 3 accepts a bare ellipsis, so I think we can leave it in. >>> >>> From what Haoyu wrote, I think he meant that the literal ". .." (mind the >>> space character) would be accepted as "...". That should be rejected. Only >>> "..." is a valid spelling for Ellipsis. >> >> Ah, I totally missed that. Sounds like another case of the -2 vs. -3 >> flag, where with -2 we should only reject it in -3 mode. > > Seriously, I don't think Ellipsis is really important enough to inject > special casing code into the Parser or Scanner. Even most people who use it > regularly won't even know that you can write it as ". . ." in Py2.
I think accepting all valid Python code is an important goal--if it's not worth a special case than I'd rather accept invalid Py3 ellipsis than reject valid Py2 ellipsis. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
