[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2022-02-04 Thread Ethan Furman
Ethan Furman added the comment: Thanks, everyone! -- components: +Library (Lib) -Regular Expressions resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.11 -Python 3.7, Python 3.8 ___

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2022-02-04 Thread Ethan Furman
Ethan Furman added the comment: New changeset fea7290a0ecee09bbce571d4d10f5881b7ea3485 by andrei kulakov in branch 'main': bpo-31369: include ``RegexFlag`` in ``re.__all__`` (GH-30279) https://github.com/python/cpython/commit/fea7290a0ecee09bbce571d4d10f5881b7ea3485 --

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2021-12-27 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 10.0 -> 11.0 pull_requests: +28495 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30279 ___ Python tracker

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2020-09-13 Thread Guido van Rossum
Guido van Rossum added the comment: What it prints is irrelevant to static checking. Currently the typeshed stub for the code already exports RegexFlag, so that the following passes mypy but fails at runtime: ``` from re import * def foo(flag: RegexFlag): return match("[a-z]+", "ABC",

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2020-09-12 Thread Ethan Furman
Ethan Furman added the comment: Guido, do you have an opinion on adding `RegexFlag` to the `re` module's `__all__` and documenting it? There is also some discussion on making these types of int-to-Enum conversions use a `module.name` repr instead of `class.name`: used to be: >>> re.I

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2019-04-06 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I am totally fine with making RegexFlag public (this may be indeed useful for static typing purposes). -- ___ Python tracker ___

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2019-03-25 Thread Ethan Furman
Ethan Furman added the comment: I see no reason no prefix `RegexFlag` with an `_`. As far as adding it to `__all__` -- I didn't originally because I was trying to mirror the original implementation, but I am not against it. I would defer that decision to those that work on typing.