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
ab778228
Kaydet (Commit)
ab778228
authored
Agu 31, 2004
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Describe non-recursive re
üst
b07aae28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
whatsnew24.tex
Doc/whatsnew/whatsnew24.tex
+13
-4
No files found.
Doc/whatsnew/whatsnew24.tex
Dosyayı görüntüle @
ab778228
...
...
@@ -1184,18 +1184,27 @@ not it's a symbolic link. This differs from the existing
\item
The regular expression language accepted by the
\module
{
re
}
module
was extended with simple conditional expressions, written as
\
code
{
(?(
\var
{
group
}
)
\var
{
A
}
|
\var
{
B
}
)
}
.
\var
{
group
}
is either a
numeric group ID or a group name defined with
\
code
{
(?P<group>...)
}
\
regexp
{
(?(
\var
{
group
}
)
\var
{
A
}
|
\var
{
B
}
)
}
.
\var
{
group
}
is either a
numeric group ID or a group name defined with
\
regexp
{
(?P<group>...)
}
earlier in the expression. If the specified group matched, the
regular expression pattern
\var
{
A
}
will be tested against the string; if
the group didn't match, the pattern
\var
{
B
}
will be used instead.
\item
The
\module
{
re
}
module is also no longer recursive, thanks
to a massive amount of work by Gustavo Niemeyer. In a recursive
regular expression engine, certain patterns result in a large amount
of C stack space being consumed, and it was possible to overflow the
stack. For example, if you matched a 30000-byte string of
\samp
{
a
}
characters against the expression
\regexp
{
(a|b)+
}
, one stack frame was
consumed per character. Python 2.3 tried to check for stack overflow
and raise a
\exception
{
RuntimeError
}
exception, but if you were
unlucky Python could dump core. Python 2.4's regular expression
engine can match this pattern without problems.
\item
A new
\function
{
socketpair()
}
function was added to the
\module
{
socket
}
module, returning a pair of connected sockets.
(Contributed by Dave Cole.)
% XXX sre is now non-recursive.
\item
The
\function
{
sys.exitfunc()
}
function has been deprecated. Code
should be using the existing
\module
{
atexit
}
module, which correctly
handles calling multiple exit functions. Eventually
...
...
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