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
c0602296
Kaydet (Commit)
c0602296
authored
Ara 16, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add "varargs" attribute.
üst
3ddee714
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
9 deletions
+26
-9
methodobject.h
Include/methodobject.h
+5
-3
methodobject.c
Objects/methodobject.c
+20
-5
modsupport.c
Python/modsupport.c
+1
-1
No files found.
Include/methodobject.h
Dosyayı görüntüle @
c0602296
...
...
@@ -30,13 +30,15 @@ extern typeobject Methodtype;
typedef
object
*
(
*
method
)
FPROTO
((
object
*
,
object
*
));
extern
object
*
newmethodobject
PROTO
((
char
*
,
method
,
object
*
));
extern
object
*
newmethodobject
PROTO
((
char
*
,
method
,
object
*
,
int
));
extern
method
getmethod
PROTO
((
object
*
));
extern
object
*
getself
PROTO
((
object
*
));
extern
int
getvarargs
PROTO
((
object
*
));
struct
methodlist
{
char
*
ml_name
;
method
ml_meth
;
char
*
ml_name
;
method
ml_meth
;
int
ml_varargs
;
};
extern
object
*
findmethod
PROTO
((
struct
methodlist
*
,
object
*
,
char
*
));
Objects/methodobject.c
Dosyayı görüntüle @
c0602296
...
...
@@ -30,16 +30,18 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
typedef
struct
{
OB_HEAD
char
*
m_name
;
method
m_meth
;
object
*
m_self
;
char
*
m_name
;
method
m_meth
;
object
*
m_self
;
int
m_varargs
;
}
methodobject
;
object
*
newmethodobject
(
name
,
meth
,
self
)
newmethodobject
(
name
,
meth
,
self
,
varargs
)
char
*
name
;
/* static string */
method
meth
;
object
*
self
;
int
varargs
;
{
methodobject
*
op
=
NEWOBJ
(
methodobject
,
&
Methodtype
);
if
(
op
!=
NULL
)
{
...
...
@@ -48,6 +50,7 @@ newmethodobject(name, meth, self)
if
(
self
!=
NULL
)
INCREF
(
self
);
op
->
m_self
=
self
;
op
->
m_varargs
=
varargs
;
}
return
(
object
*
)
op
;
}
...
...
@@ -74,6 +77,17 @@ getself(op)
return
((
methodobject
*
)
op
)
->
m_self
;
}
int
getvarargs
(
op
)
object
*
op
;
{
if
(
!
is_methodobject
(
op
))
{
err_badcall
();
return
-
1
;
}
return
((
methodobject
*
)
op
)
->
m_varargs
;
}
/* Methods (the standard built-in methods, that is) */
static
void
...
...
@@ -168,7 +182,8 @@ findmethod(ml, op, name)
return
listmethods
(
ml
);
for
(;
ml
->
ml_name
!=
NULL
;
ml
++
)
{
if
(
strcmp
(
name
,
ml
->
ml_name
)
==
0
)
return
newmethodobject
(
ml
->
ml_name
,
ml
->
ml_meth
,
op
);
return
newmethodobject
(
ml
->
ml_name
,
ml
->
ml_meth
,
op
,
ml
->
ml_varargs
);
}
err_setstr
(
AttributeError
,
name
);
return
NULL
;
...
...
Python/modsupport.c
Dosyayı görüntüle @
c0602296
...
...
@@ -45,7 +45,7 @@ initmodule(name, methods)
for
(
ml
=
methods
;
ml
->
ml_name
!=
NULL
;
ml
++
)
{
sprintf
(
namebuf
,
"%s.%s"
,
name
,
ml
->
ml_name
);
v
=
newmethodobject
(
strdup
(
namebuf
),
ml
->
ml_meth
,
(
object
*
)
NULL
);
(
object
*
)
NULL
,
ml
->
ml_varargs
);
/* XXX The strdup'ed memory is never freed */
if
(
v
==
NULL
||
dictinsert
(
d
,
ml
->
ml_name
,
v
)
!=
0
)
{
fprintf
(
stderr
,
"initializing module: %s
\n
"
,
name
);
...
...
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