mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #28727: Optimize pattern_richcompare() for a==a
A pattern is equal to itself.
This commit is contained in:
parent
e670b2d5c3
commit
bcf4dccfa7
2 changed files with 10 additions and 0 deletions
|
@ -1781,6 +1781,10 @@ SUBPATTERN None 0 0
|
|||
def test_pattern_compare(self):
|
||||
pattern1 = re.compile('abc', re.IGNORECASE)
|
||||
|
||||
# equal to itself
|
||||
self.assertEqual(pattern1, pattern1)
|
||||
self.assertFalse(pattern1 != pattern1)
|
||||
|
||||
# equal
|
||||
re.purge()
|
||||
pattern2 = re.compile('abc', re.IGNORECASE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue