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
04a9a0e9
Kaydet (Commit)
04a9a0e9
authored
Ara 13, 2007
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify implementation of __replace__()
üst
e5529591
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
collections.rst
Doc/library/collections.rst
+1
-1
collections.py
Lib/collections.py
+1
-1
No files found.
Doc/library/collections.rst
Dosyayı görüntüle @
04a9a0e9
...
...
@@ -396,7 +396,7 @@ Example::
return dict(zip(('x', 'y'), self))
def __replace__(self, **kwds):
'Return a new Point object replacing specified fields with new values'
return Point(**dict(zip(('x', 'y'), self)
+ kwds.items()
))
return Point(**dict(zip(('x', 'y'), self)
, **kwds
))
x = property(itemgetter(0))
y = property(itemgetter(1))
...
...
Lib/collections.py
Dosyayı görüntüle @
04a9a0e9
...
...
@@ -70,7 +70,7 @@ def namedtuple(typename, field_names, verbose=False):
return dict(zip(
%(field_names)
r, self))
def __replace__(self, **kwds):
'Return a new
%(typename)
s object replacing specified fields with new values'
return
%(typename)
s(**dict(zip(
%(field_names)
r, self)
+ kwds.items()
))
\n
'''
%
locals
()
return
%(typename)
s(**dict(zip(
%(field_names)
r, self)
, **kwds
))
\n
'''
%
locals
()
for
i
,
name
in
enumerate
(
field_names
):
template
+=
'
%
s = property(itemgetter(
%
d))
\n
'
%
(
name
,
i
)
if
verbose
:
...
...
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