News for hackers. Stuff that matters.
Re:Destroy All Software relaunches by paxcoder on Monday August 08, 2016 @09:24AM (#12247483)
Python's grammar is context-sensitive until the lexer processes indentation. There are other programming languages whose grammar is context-free.
Re:Destroy All Software relaunches by gary_bernhardt on Monday August 08, 2016 @01:10PM (#12249272)
I went back and forth on that statement for exactly this reason, but kept it because the whitespace is handled in the lexer, as you mentioned. The Python grammar itself is context-free, and the grammar is the only part that I expect the series to examine.
Re:Destroy All Software relaunches by paxcoder on Monday August 08, 2016 @03:44PM (#12250368)
You imply that indentation isn't a part of Python's grammar...
Re:Destroy All Software relaunches by gary_bernhardt on Monday August 08, 2016 @06:57PM (#12251380)
It's not part of the Python grammar as specified in the file called Grammar in the canonical implementation of the language (https://github.com/python/cpython/blob/master/Grammar/Gramma...). Of course it's part of the grammar in the larger sense. I don't think that that distinction is important when trying to convince someone with no theoretical background to learn these topics, which is what the video in question is trying to do.