[New-bugs-announce] [issue40016] Clarify flag case in `re` module

Ram Rachum report at bugs.python.org
Thu Mar 19 13:40:50 EDT 2020


New submission from Ram Rachum <ram at rachum.com>:

Today I was tripped up by an inconsistency in the `re` docstring. I wanted to use DOTALL as a flag inside my regex, rather than as an argument to the `compile` function. Here are two lines from the docstring:

    (?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below).
    ...
    S  DOTALL      "." matches any character at all, including the newline.

The DOTALL flag appears as an uppercase S in 2 places, and as a lowercase s in one place. This is confusing, and I initially tried using the uppercase S only to get an error.

I'm attaching a PR to this ticket.

----------
components: Library (Lib)
messages: 364617
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Clarify flag case in `re` module
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40016>
_______________________________________


More information about the New-bugs-announce mailing list