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
3d4c316f
Kaydet (Commit)
3d4c316f
authored
Kas 12, 2007
tarafından
Christian Heimes
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added new decorator syntax to property.__doc__
Guido prefers _x over __x.
üst
03c1d1e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
descrobject.c
Objects/descrobject.c
+14
-4
No files found.
Objects/descrobject.c
Dosyayı görüntüle @
3d4c316f
...
@@ -1268,10 +1268,20 @@ PyDoc_STRVAR(property_doc,
...
@@ -1268,10 +1268,20 @@ PyDoc_STRVAR(property_doc,
"fset is a function for setting, and fdel a function for del'ing, an
\n
"
"fset is a function for setting, and fdel a function for del'ing, an
\n
"
"attribute. Typical use is to define a managed attribute x:
\n
"
"attribute. Typical use is to define a managed attribute x:
\n
"
"class C(object):
\n
"
"class C(object):
\n
"
" def getx(self): return self.__x
\n
"
" def getx(self): return self._x
\n
"
" def setx(self, value): self.__x = value
\n
"
" def setx(self, value): self._x = value
\n
"
" def delx(self): del self.__x
\n
"
" def delx(self): del self._x
\n
"
" x = property(getx, setx, delx,
\"
I'm the 'x' property.
\"
)"
);
" x = property(getx, setx, delx,
\"
I'm the 'x' property.
\"
)
\n
"
"
\n
"
"Decorators makes defining new or modifying existing properties easy:
\n
"
"class C(object):
\n
"
" @property
\n
"
" def x(self): return self._x
\n
"
" @x.setter
\n
"
" def x(self, value): self._x = value
\n
"
" @x.deleter
\n
"
" def x(self): del self._x
\n
"
);
static
int
static
int
property_traverse
(
PyObject
*
self
,
visitproc
visit
,
void
*
arg
)
property_traverse
(
PyObject
*
self
,
visitproc
visit
,
void
*
arg
)
...
...
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