[Python-ideas] Transportable indent level markers. /// ; ; ; \\\
python at mrabarnett.plus.com
Tue Dec 13 00:15:39 CET 2011
On 12/12/2011 22:07, Ron Adam wrote:
> While typing this reply to the "Alternate Suite Delineation Syntax For
> Python?" thread. I realized that having things all on a single line
> isn't important or needed!!! Yes, it's not needed for templates, or
> code generation. So this is an alternate to the alternate.
> What is needed is a uniform way to represent indenting that is easy to
> transport to (ie paste into) code with different indent levels.
> INDENT LEVEL MARKERS:
> Offer a new way to spell<indent+1>,<indent+0>, and<indent-1>.
> To make that work, we need to use unique character sequences that aren't
> already used. After some thought, I came up with these indent-markers.
> /// # indent level +1
> ;;; # indent level +0
> \\\ # indent level -1
> These are unique enough to be easy to see, and the tripled versions of
> them aren't really that bad as we already have triple quotes, and they
> would be less than the white space they are replacing in most cases.
> So this isn't brackets, or braces. It would be just an alternate
> spelling in already valid python. It should not effect the parser,
> grammar, or interpreter in any way if it is done in pythons
> tokenizer. :-)
If the problem is with leading whitespace being stripped, then what
about the non-breaking space ("\xA0")? We all use Unicode now, don't
The bonus is that it still looks like a space.
More information about the Python-ideas