Skip to content

Commit 49e3881

Browse files
author
Matthew Barnett
committed
Git PR 585: Fix AttributeError: 'AnyAll' object has no attribute '_key'
1 parent 183a653 commit 49e3881

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Version: 2025.9.1
2+
3+
Git PR 585: Fix AttributeError: 'AnyAll' object has no attribute '_key'
4+
15
Version: 2025.8.29
26

37
Git issue 584: AttributeError: 'AnyAll' object has no attribute 'positive'

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "regex"
7-
version = "2025.8.29"
7+
version = "2025.9.1"
88
description = "Alternative regular expression module, to replace re."
99
readme = "README.rst"
1010
authors = [

regex_3/_regex_core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,9 +1997,11 @@ class AnyAll(Any):
19971997
_op_name = "ANY_ALL"
19981998

19991999
def __init__(self):
2000-
self.positive = True
2001-
self.zerowidth = False
2002-
self.case_flags = 0
2000+
self.positive = True
2001+
self.zerowidth = False
2002+
self.case_flags = 0
2003+
2004+
self._key = self.__class__, self.positive
20032005

20042006
class AnyU(Any):
20052007
_opcode = {False: OP.ANY_U, True: OP.ANY_U_REV}

regex_3/regex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
"VERSION1", "X", "VERBOSE", "W", "WORD", "error", "Regex", "__version__",
242242
"__doc__", "RegexFlag"]
243243

244-
__version__ = "2.5.160"
244+
__version__ = "2.5.161"
245245

246246
# --------------------------------------------------------------------
247247
# Public interface.

regex_3/test_regex.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4405,6 +4405,9 @@ def test_hg_bugs(self):
44054405
# Git issue 584: AttributeError: 'AnyAll' object has no attribute 'positive'
44064406
self.assertEqual(bool(regex.compile('(\\s|\\S)')), True)
44074407

4408+
# Git PR 585: Fix AttributeError: 'AnyAll' object has no attribute '_key'
4409+
self.assertEqual(bool(regex.compile('(?:[\\S\\s]|[A-D][M-Z])')), True)
4410+
44084411
def test_fuzzy_ext(self):
44094412
self.assertEqual(bool(regex.fullmatch(r'(?r)(?:a){e<=1:[a-z]}', 'e')),
44104413
True)

0 commit comments

Comments
 (0)