[Python-Dev] newb question

"Martin v. Löwis" martin at v.loewis.de
Thu Aug 30 00:38:22 CEST 2007


> Can someone explain how this works please?

Don't try reading these files. They are generated; read Parser/pgen
instead (which generates these files), or see how they are used.

> I've never come across 
> escape sequences like this; I've only ever seen \0 (nul) before; not \2, 
> \3 etc.  or are they not escape sequences, but literal forward slashes.

They are octal escapes; this is a standard C construct. You need three
octal digits to build one character. So it's \222, not \2, and \310, not
\3. The integer values are 0222 and 0310, respectively (i.e. 146 and
200).

HTH,
Martin


More information about the Python-Dev mailing list