[Python-Dev] Re: [Python-checkins] python/dist/src/Lib warnings.py,1.19,1.20
Aahz
aahz@pythoncraft.com
Thu, 15 May 2003 08:44:34 -0400
On Thu, May 15, 2003, Fred L. Drake, Jr. wrote:
> Guido van Rossum writes:
>>
>> Agreed, but you're still using two levels of quoting, and with
>> anything less, "foo.bar" will also match a module named "foolbar".
>
> Agreed. "foo\.bar" will match "foolbar" as well, but 'foo\.bar' only
> matches "foo.bar". The advantage of single quotes is that you're not
> escaping the escape characters with themselves; what's inside the
> quotes is simple RE syntax, so you only need to think about one of the
> layers at a time.
The point is that with current behavior you can use foo.bar on the
command line and not worry, because "." is a meta character in neither
shell nor Python.
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
"In many ways, it's a dull language, borrowing solid old concepts from
many other languages & styles: boring syntax, unsurprising semantics,
few automatic coercions, etc etc. But that's one of the things I like
about it." --Tim Peters on Python, 16 Sep 93