Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

It turns out that pip uses sre_constants in its copy of pyparsing. The problem 
is already fixed in the upstream of pyparsing and soon should be fixed in pip. 
We still need to keep sre_constants and maybe other sre_* modules, but 
deprecate them.

> Could the sre_parse and sre_constants modules be kept with public names (i.e. 
> without the leading underscore) but within the re namespace?

It is a good idea which will allow to minimize breakage in short term. You can 
write "from re import sre_parse", and it would work in old and new versions 
because sre_parse and sre_compile were imported in the re module. This trick 
does not work with sre_constants, you still need try/except.

But the code that depends on these modules is fragile and can be broken by 
other ways.

> Please don't merge too close to the 3.11 beta1 release date, I'll submit PRs 
> after this merged.

I am going to implement step 2 only after merging your changes for issue23689.

----------

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

Reply via email to