[Python-Dev] PEP 30XZ: Simplified Parsing (original) (raw)
Guido van Rossum guido at python.org
Thu May 3 20:35:50 CEST 2007
- Previous message: [Python-Dev] PEP 30XZ: Simplified Parsing
- Next message: [Python-Dev] PEP 30XZ: Simplified Parsing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 5/3/07, Georg Brandl <g.brandl at gmx.net> wrote:
> These are raw strings if you didn't notice.
It's all in the implementation. The tokenizer takes it as an escape sequence -- it doesn't specialcase raw strings -- the AST builder (parsestr() in ast.c) doesn't.
FWIW, it wasn't designed this way so as to be easy to implement. It was designed this way because the overwhelming use case is regular expressions, where one needs to be able to escape single and double quotes -- the re module unescapes " and ' when it encounters them.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] PEP 30XZ: Simplified Parsing
- Next message: [Python-Dev] PEP 30XZ: Simplified Parsing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]