Issue1108060
Created on 2005-01-24 02:09 by spiv, last changed 2005-01-24 04:02 by spiv. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg24024 - (view) | Author: Andrew Bennetts (spiv) | Date: 2005-01-24 02:09 | |
According to table in http://docs.python.org/ref/strings.html, the list of valid escape sequences in strings does not include \0. It appears that the parser actually allows \n for values of n in the range 0-7, but this is not documented. Many people with exposure to C expect \0 to be valid (and it does work, after all!). A quick grep on my system finds many libraries use \0 in string literals, including: - Twisted - HTMLgen - PIL - numarray - Reportlab - and of course the standard library: tarfile, gzip, pystone, binhex, and others. I suggest the documentation be updated to officially support \0 as a valid escape. I don't care as much about \1 through to \7... I was surprised they worked (and then surprised that \8 and \9 didn't), and I think they might as well be deprecated, but I don't care much either way. |
|||
| msg24025 - (view) | Author: Tim Peters (tim_one) * ![]() |
Date: 2005-01-24 03:21 | |
Logged In: YES user_id=31435 Look at the table of escapes again, especially the line with footnotes 3 and 5; that line documents the octal escapes, including all cases you've mentioned here. |
|||
| msg24026 - (view) | Author: Andrew Bennetts (spiv) | Date: 2005-01-24 04:02 | |
Logged In: YES user_id=50945 So it does. I suck. Thanks Tim! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2005-01-24 02:09:00 | spiv | create | |
