Simplify __all__ for modules beginning with 'm' to 't' (#8028)

This commit is contained in:
Alex Waygood
2022-06-07 20:14:15 +01:00
committed by GitHub
parent b88ea4a499
commit 591593c85f
15 changed files with 620 additions and 1626 deletions

View File

@@ -13,101 +13,41 @@ if sys.version_info >= (3, 7):
else:
from typing import Match, Pattern
__all__ = [
"match",
"fullmatch",
"search",
"sub",
"subn",
"split",
"findall",
"finditer",
"compile",
"purge",
"template",
"escape",
"error",
"A",
"I",
"L",
"M",
"S",
"X",
"U",
"ASCII",
"IGNORECASE",
"LOCALE",
"MULTILINE",
"DOTALL",
"VERBOSE",
"UNICODE",
]
if sys.version_info >= (3, 8):
__all__ += ["Match", "Pattern"]
if sys.version_info >= (3, 11):
__all__ = [
"match",
"fullmatch",
"search",
"sub",
"subn",
"split",
"findall",
"finditer",
"compile",
"purge",
"escape",
"error",
"Pattern",
"Match",
"A",
"I",
"L",
"M",
"S",
"X",
"U",
"ASCII",
"IGNORECASE",
"LOCALE",
"MULTILINE",
"DOTALL",
"VERBOSE",
"UNICODE",
"RegexFlag",
"NOFLAG",
]
elif sys.version_info >= (3, 8):
__all__ = [
"match",
"fullmatch",
"search",
"sub",
"subn",
"split",
"findall",
"finditer",
"compile",
"purge",
"template",
"escape",
"error",
"Pattern",
"Match",
"A",
"I",
"L",
"M",
"S",
"X",
"U",
"ASCII",
"IGNORECASE",
"LOCALE",
"MULTILINE",
"DOTALL",
"VERBOSE",
"UNICODE",
]
else:
__all__ = [
"match",
"fullmatch",
"search",
"sub",
"subn",
"split",
"findall",
"finditer",
"compile",
"purge",
"template",
"escape",
"error",
"A",
"I",
"L",
"M",
"S",
"X",
"U",
"ASCII",
"IGNORECASE",
"LOCALE",
"MULTILINE",
"DOTALL",
"VERBOSE",
"UNICODE",
]
__all__ += ["NOFLAG", "RegexFlag"]
class RegexFlag(enum.IntFlag):
A = sre_compile.SRE_FLAG_ASCII