Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0b87b69a
Kaydet (Commit)
0b87b69a
authored
Kas 22, 2016
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.6
üst
9ad8a639
bcf4dccf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
test_re.py
Lib/test/test_re.py
+4
-0
_sre.c
Modules/_sre.c
+7
-1
No files found.
Lib/test/test_re.py
Dosyayı görüntüle @
0b87b69a
...
@@ -1781,6 +1781,10 @@ SUBPATTERN None 0 0
...
@@ -1781,6 +1781,10 @@ SUBPATTERN None 0 0
def
test_pattern_compare
(
self
):
def
test_pattern_compare
(
self
):
pattern1
=
re
.
compile
(
'abc'
,
re
.
IGNORECASE
)
pattern1
=
re
.
compile
(
'abc'
,
re
.
IGNORECASE
)
# equal to itself
self
.
assertEqual
(
pattern1
,
pattern1
)
self
.
assertFalse
(
pattern1
!=
pattern1
)
# equal
# equal
re
.
purge
()
re
.
purge
()
pattern2
=
re
.
compile
(
'abc'
,
re
.
IGNORECASE
)
pattern2
=
re
.
compile
(
'abc'
,
re
.
IGNORECASE
)
...
...
Modules/_sre.c
Dosyayı görüntüle @
0b87b69a
...
@@ -2683,12 +2683,18 @@ pattern_richcompare(PyObject *lefto, PyObject *righto, int op)
...
@@ -2683,12 +2683,18 @@ pattern_richcompare(PyObject *lefto, PyObject *righto, int op)
if
(
Py_TYPE
(
lefto
)
!=
&
Pattern_Type
||
Py_TYPE
(
righto
)
!=
&
Pattern_Type
)
{
if
(
Py_TYPE
(
lefto
)
!=
&
Pattern_Type
||
Py_TYPE
(
righto
)
!=
&
Pattern_Type
)
{
Py_RETURN_NOTIMPLEMENTED
;
Py_RETURN_NOTIMPLEMENTED
;
}
}
if
(
lefto
==
righto
)
{
/* a pattern is equal to itself */
return
PyBool_FromLong
(
op
==
Py_EQ
);
}
left
=
(
PatternObject
*
)
lefto
;
left
=
(
PatternObject
*
)
lefto
;
right
=
(
PatternObject
*
)
righto
;
right
=
(
PatternObject
*
)
righto
;
cmp
=
(
left
->
flags
==
right
->
flags
cmp
=
(
left
->
flags
==
right
->
flags
&&
left
->
isbytes
==
right
->
isbytes
&&
left
->
isbytes
==
right
->
isbytes
&&
left
->
codesize
&&
right
->
codesize
);
&&
left
->
codesize
==
right
->
codesize
);
if
(
cmp
)
{
if
(
cmp
)
{
/* Compare the code and the pattern because the same pattern can
/* Compare the code and the pattern because the same pattern can
produce different codes depending on the locale used to compile the
produce different codes depending on the locale used to compile the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment