classification
Title: re.flags not documented in Module Contents as promised.
Type: enhancement Stage: needs patch
Components: Documentation, Regular Expressions Versions: Python 3.7, Python 3.6, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: 4Dummies, docs@python, ezio.melotti, mrabarnett, r.david.murray
Priority: normal Keywords:

Created on 2016-12-12 18:57 by 4Dummies, last changed 2017-11-16 14:14 by serhiy.storchaka.

Messages (7)
msg283034 - (view) Author: kevin (4Dummies) Date: 2016-12-12 18:57
In the online documentation of module re 
  (https://docs.python.org/3.5/library/re.html) 
under 
  6.2.1. Regular Expression Syntax
for item
  (?aiLmsux)
we are promised "The flags are described in Module Contents"
but no description is found there.  In fact a number of other references are found to flags, but no description of the individual flags.  AFAICT the closest thing to a description is found at the original reference -- at least it gives a code and name for each one.
msg283037 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-12 19:03
When I follow the link to module contents, I find a list of the flags with their descriptions.  (re.A, re.I, etc, etc).  Perhaps you are confusing the letters used in the regular expression to represent the flags with the flags themselves?  I'm not sure how we could make that clearer.
msg283462 - (view) Author: kevin (4Dummies) Date: 2016-12-17 03:08
Ordinarily when I see a cross-reference like that "the flags are described
in foo" I expect foo to have a heading "FLAGS" so I can tell I'm looking at
what was promised.  Not knowing much about flags, it was not clear to me
that those scattered lines re.A through re.X were the promised
descriptions.  I didn't even notice them until now, partly because it's
made more confusing by all the stuff that's out of alphabetic order.  Or I
think it is -- it's hard to tell because of things like re.S and re.DOTALL
being together.  My current guess is that the uppercase things come before
lowercase, but those odd pairings are definitely messing with my mind.

All of which is just to say it probably makes perfect sense to someone
who's used to it, but it's hard on someone new to these docs, and I'm not
even new to Python, just to the re module.

On Mon, Dec 12, 2016 at 11:03 AM, R. David Murray <report@bugs.python.org>
wrote:

>
> R. David Murray added the comment:
>
> When I follow the link to module contents, I find a list of the flags with
> their descriptions.  (re.A, re.I, etc, etc).  Perhaps you are confusing the
> letters used in the regular expression to represent the flags with the
> flags themselves?  I'm not sure how we could make that clearer.
>
> ----------
> nosy: +r.david.murray
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue28951>
> _______________________________________
>

-- 
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.
msg283487 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-17 14:13
Making a 'flags' subheading in module contents would be reasonable.  Alternatively we could just drop that parenthetical, since the descriptions for each flag are themselves cross-linked.
msg283493 - (view) Author: kevin (4Dummies) Date: 2016-12-17 15:25
Well, my original problem is that I wanted to find out what the flags did
and could not find any pointer in the table of contents.  I think they
deserve either really good cross-references, or a heading in the contents.
And a non-confusing alphabetized list, if they're going to be mixed in with
other module contents.

On Sat, Dec 17, 2016 at 6:13 AM, R. David Murray <report@bugs.python.org>
wrote:

>
> R. David Murray added the comment:
>
> Making a 'flags' subheading in module contents would be reasonable.
> Alternatively we could just drop that parenthetical, since the descriptions
> for each flag are themselves cross-linked.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue28951>
> _______________________________________
>

-- 
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.
msg283494 - (view) Author: kevin (4Dummies) Date: 2016-12-17 15:29
Oh, and on the alphabetized list, I suggest NOT listing synonyms together,
but just mark some as "synonym for X" and listing them all alphabetically
(according to "en" collation, not "C" so upper- and lower-case sort
together, not separately).

On Sat, Dec 17, 2016 at 6:13 AM, R. David Murray <report@bugs.python.org>
wrote:

>
> R. David Murray added the comment:
>
> Making a 'flags' subheading in module contents would be reasonable.
> Alternatively we could just drop that parenthetical, since the descriptions
> for each flag are themselves cross-linked.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue28951>
> _______________________________________
>

-- 
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.
msg283503 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-17 18:15
(Please delete the message you are replying to when responding to bug tracker emails.)

I think a section heading would be good (three subheads under module contents: functions, flags, and exceptions).  I'm less in favor of alphabetical entries for synonyms.  We'll see what others think.
History
Date User Action Args
2017-11-16 14:14:54serhiy.storchakasetfiles: - unnamed
2017-11-16 14:14:49serhiy.storchakasetfiles: - unnamed
2017-11-16 14:14:44serhiy.storchakasetfiles: - unnamed
2017-11-16 14:14:36serhiy.storchakasetnosy: + ezio.melotti, mrabarnett
stage: needs patch

components: + Regular Expressions
versions: + Python 2.7, Python 3.6, Python 3.7, - Python 3.5
2016-12-17 18:15:25r.david.murraysetmessages: + msg283503
2016-12-17 15:29:154Dummiessetfiles: + unnamed

messages: + msg283494
2016-12-17 15:25:564Dummiessetfiles: + unnamed

messages: + msg283493
2016-12-17 14:13:28r.david.murraysetmessages: + msg283487
2016-12-17 03:08:244Dummiessetfiles: + unnamed

messages: + msg283462
2016-12-12 19:03:22r.david.murraysetnosy: + r.david.murray
messages: + msg283037
2016-12-12 18:57:284Dummiescreate