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
e9b1bf47
Kaydet (Commit)
e9b1bf47
authored
Mar 20, 2005
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Describe various things
üst
31a58df5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
6 deletions
+44
-6
whatsnew25.tex
Doc/whatsnew/whatsnew25.tex
+44
-6
No files found.
Doc/whatsnew/whatsnew25.tex
Dosyayı görüntüle @
e9b1bf47
...
...
@@ -41,7 +41,7 @@ language.
\item
The
\function
{
min()
}
and
\function
{
max()
}
built-in functions
gained a
\code
{
key
}
keyword argument analogous to the
\code
{
key
}
argument for
\
function
{
sort()
}
. This argument supplies a function
argument for
\
method
{
sort()
}
. This argument supplies a function
that takes a single argument and is called for every value in the list;
\function
{
min()
}
/
\function
{
max()
}
will return the element with the
smallest/largest return value from this function.
...
...
@@ -55,10 +55,17 @@ print max(L, key=len)
print max(L)
\end{verbatim}
% XXX also supported by heapq.nsmallest() and heapq.nlargest().
(Contributed by Steven Bethard and Raymond Hettinger.)
\item
The list of base classes in a class definition can now be empty.
As an example, this is now legal:
\begin{verbatim}
class C():
pass
\end{verbatim}
(Implemented by Brett Cannon.)
\end{itemize}
...
...
@@ -95,17 +102,48 @@ details.
% datetime.datetime() now has a strptime class method which can be used to
% create datetime object using a string and format.
\item
The
\function
{
nsmallest()
}
and
\function
{
nlargest()
}
functions in the
\module
{
heapq
}
module
now support a
\code
{
key
}
keyword argument similar to the one
provided by the
\function
{
min()
}
/
\function
{
max()
}
functions
and the
\method
{
sort()
}
methods. For example:
Example:
\begin{verbatim}
>>> import heapq
>>> L = ["short", 'medium', 'longest', 'longer still']
>>> heapq.nsmallest(2, L) # Return two lowest elements, lexicographically
['longer still', 'longest']
>>> heapq.nsmallest(2, L, key=len) # Return two shortest elements
['short', 'medium']
\end{verbatim}
(Contributed by Raymond Hettinger.)
% itertools.islice() now accepts None for the start and step arguments.
\item
New module:
\module
{
spwd
}
provides functions for accessing the
shadow password database on systems that support it.
% XXX give example
% XXX os.stat_float_times is now True
\item
The
\module
{
os
}
module underwent a number of changes. The
\member
{
stat
_
float
_
times
}
variable now defaults to true, meaning that
\function
{
os.stat()
}
will now return time values as floats. (This
doesn't necessarily mean that
\function
{
os.stat()
}
will return times
that are precise to fractions of a second; not all systems support
such precision.)
Also, constants named
\member
{
os.SEEK
_
SET
}
,
\member
{
os.SEEK
_
CUR
}
, and
\member
{
os.SEEK
_
END
}
have been added; these are the parameters to the
\function
{
os.lseek()
}
function.
\item
The
\class
{
TarFile
}
class in the
\module
{
tarfile
}
module now has
a
\method
{
extractall()
}
method that extracts all members from the
archive into the current working directory. It's also possible to set
a different directory as the extraction target, and to unpack only a
subset of the archive's members. (Contributed by Lars Gust
\"
abel.)
% os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
\end{itemize}
%======================================================================
...
...
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