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
1041f748
Kaydet (Commit)
1041f748
authored
Şub 26, 2008
tarafından
Mark Summerfield
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Updated super() as per
http://www.artima.com/weblogs/viewpost.jsp?thread=208549
but would be worth someone else checking if poss.
üst
836baa53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
functions.rst
Doc/library/functions.rst
+15
-9
No files found.
Doc/library/functions.rst
Dosyayı görüntüle @
1041f748
...
...
@@ -1025,25 +1025,31 @@ available. They are listed here in alphabetical order.
sequence of strings is by calling ``''.join(sequence)``.
.. function:: super(
type[, object-or-type
])
.. function:: super(
[type[, object-or-type]
])
.. XXX
need to document PEP "new super"
.. XXX
updated as per http://www.artima.com/weblogs/viewpost.jsp?thread=208549 but needs checking
Return the superclass of *type*. If the second argument is omitted the super
object returned is unbound. If the second argument is an object,
``isinstance(obj, type)`` must be true. If the second argument is a type,
Return the superclass of *type*.
Calling :func:`super()` without arguments is equivalent to
``super(this_class, first_arg)``. If called with one
argument the super object returned is unbound. If called with two
arguments and the second argument is an object, ``isinstance(obj,
type)`` must be true. If the second argument is a type,
``issubclass(type2, type)`` must be true.
A typical use for calling a cooperative superclass method is::
class C(B):
def meth(self, arg):
super(
C, self).meth
(arg)
def meth
od
(self, arg):
super(
).method(arg) # This does the same thing as: super(C, self).method
(arg)
Note that :func:`super` is implemented as part of the binding process for
explicit dotted attribute lookups such as ``super(
C, self
).__getitem__(name)``.
explicit dotted attribute lookups such as ``super().__getitem__(name)``.
Accordingly, :func:`super` is undefined for implicit lookups using statements or
operators such as ``super(C, self)[name]``.
operators such as ``super()[name]``. Also, :func:`super` is not
limited to use inside methods: under the hood it searches the stack
frame for the class (``__class__``) and the first argument.
.. function:: tuple([iterable])
...
...
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