[Python-ideas] Alternate quote delimiters

Greg Ewing greg.ewing at canterbury.ac.nz
Sun May 13 02:58:59 CEST 2007


Jim Jewett wrote:

>  What if the character were limited to the opening of a
> bracketed-pair, such as {[(  Or is that just as bad, and less flexible
> to  boot? }]}

This would be better, I think, as then nested occurrences
of the bracket chars could be skipped without having to
pick a different character for each level of quoting.

It could even be restricted to just one kind of bracket
if desired without losing anything.

> How serious is this problem?
> 
>     r"The Windows path is C:\Foo\Bar\Baz\X"[:-1]
> 
> is awkward, but ... how much complexity do we want to incur avoiding it?

If you use os.path.join and friends to manipulate your
paths (as you should!) you will hardly ever have to deal
with a path containing a trailing backslash in the first
place. So I wouldn't worry about it much.

--
Greg



More information about the Python-ideas mailing list