Sion Arrowsmith wrote: > Kent Johnson <[EMAIL PROTECTED]> wrote: > >>Sion Arrowsmith wrote: >> >>>(and please avoid the abuse of raw strings for Windows paths). >> >>Why do you consider that abuse of raw strings? > > I consider it abuse because it's not what they were invented for. > I consider discouraging it to be a good thing in order to reduce > the chances of people being bitten by, for instance: > >>>>os.listdir(r"C:\") > > File "<stdin>", line 1 > os.listdir(r"C:\") > ^ > SyntaxError: EOL while scanning single-quoted string > > and getting all confused on this group.
Judging from the traffic here, people are far more often bitten by *not* using raw strings for paths containing \ than they are by using them for paths ending with \. So perhaps we should encourage raw strings for Windows paths. ;) Kent -- http://mail.python.org/mailman/listinfo/python-list