New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

In 8a3ebf8ca87a7d2989148d7c218974ab4235ca5d, with synchronizing regex engine 
with SRE 0.9.6, the class State in sre_parse.py was renamed to Pattern and the 
following comment was added: "master pattern object.  keeps track of global 
attributes".

This name is incorrect and misleading. This class doesn't represents a pattern 
in any sense. It just keeps global flags and groups information for parser. 
There is a class SupParser in sre_parse.py that represents a pattern or its 
part in intermediate representation, and there is a class Pattern defined in 
sre.c and exposed publicly, that represents a compiled pattern.

The proposed PR renames Pattern back to State and renames attribute, parameter 
and variable names for referring to objects of this class from pattern to 
state. All this is an internal API, but since there may be a third-party that 
uses it, it is for developer version only.

----------
components: Library (Lib), Regular Expressions
messages: 325359
nosy: effbot, ezio.melotti, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Incorrect class name Pattern in sre_parse.py
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34681>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to