From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org, Collin Funk <collin.funk1@gmail.com>
Subject: Re: [PATCH] gnulib-tool.py: Fix configure.ac output.
Date: Wed, 28 Feb 2024 00:39:57 +0100 [thread overview]
Message-ID: <6284451.Sgy9Pd6rRy@nimes> (raw)
In-Reply-To: <2316ff4f-c730-4a92-9d02-e4b7bd016440@gmail.com>
Collin Funk wrote:
> > I guess I wasn't very familiar with raw strings when I did this change.
>
> No worries, it was pretty easy to find and fix. I remember a professor
> in college telling us to always use them for Python regular
> expressions. It seems this is also recommended by the Python people,
> see the '\' character under this page:
>
> https://docs.python.org/3/library/re.html#regular-expression-syntax
Indeed, this doc contains the explanation for the 'pycodestyle'
warning that I was seeing. With a plain string instead of a raw string,
I get:
$ pycodestyle *.py
...
GLEmiter.py:535:26: W605 invalid escape sequence '\.'
GLEmiter.py:535:35: W605 invalid escape sequence '\.'
...
which indicates that the Python parser would have eaten up the backslash
before the regular expression engine could see it.
Bruno
next prev parent reply other threads:[~2024-02-27 23:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 22:31 [PATCH] gnulib-tool.py: Fix configure.ac output Collin Funk
2024-02-27 22:39 ` Bruno Haible
2024-02-27 23:01 ` Collin Funk
2024-02-27 23:39 ` Bruno Haible [this message]
2024-02-28 0:04 ` Collin Funk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6284451.Sgy9Pd6rRy@nimes \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
--cc=collin.funk1@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).