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
a6cd4e65
Kaydet (Commit)
a6cd4e65
authored
Kas 18, 2002
tarafından
Neil Schemenauer
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add nb_remainder (i.e. __mod__) slot to str type. Fixes SF bug #615506.
üst
2c77e908
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
stringobject.c
Objects/stringobject.c
+22
-2
No files found.
Objects/stringobject.c
Dosyayı görüntüle @
a6cd4e65
...
@@ -3126,9 +3126,28 @@ basestring_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -3126,9 +3126,28 @@ basestring_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return
NULL
;
return
NULL
;
}
}
static
PyObject
*
string_mod
(
PyObject
*
v
,
PyObject
*
w
)
{
if
(
!
PyString_Check
(
v
))
{
Py_INCREF
(
Py_NotImplemented
);
return
Py_NotImplemented
;
}
return
PyString_Format
(
v
,
w
);
}
PyDoc_STRVAR
(
basestring_doc
,
PyDoc_STRVAR
(
basestring_doc
,
"Type basestring cannot be instantiated; it is the base for str and unicode."
);
"Type basestring cannot be instantiated; it is the base for str and unicode."
);
static
PyNumberMethods
string_as_number
=
{
0
,
/*nb_add*/
0
,
/*nb_subtract*/
0
,
/*nb_multiply*/
0
,
/*nb_divide*/
string_mod
,
/*nb_remainder*/
};
PyTypeObject
PyBaseString_Type
=
{
PyTypeObject
PyBaseString_Type
=
{
PyObject_HEAD_INIT
(
&
PyType_Type
)
PyObject_HEAD_INIT
(
&
PyType_Type
)
0
,
0
,
...
@@ -3190,7 +3209,7 @@ PyTypeObject PyString_Type = {
...
@@ -3190,7 +3209,7 @@ PyTypeObject PyString_Type = {
0
,
/* tp_setattr */
0
,
/* tp_setattr */
0
,
/* tp_compare */
0
,
/* tp_compare */
(
reprfunc
)
string_repr
,
/* tp_repr */
(
reprfunc
)
string_repr
,
/* tp_repr */
0
,
/* tp_as_number */
&
string_as_number
,
/* tp_as_number */
&
string_as_sequence
,
/* tp_as_sequence */
&
string_as_sequence
,
/* tp_as_sequence */
&
string_as_mapping
,
/* tp_as_mapping */
&
string_as_mapping
,
/* tp_as_mapping */
(
hashfunc
)
string_hash
,
/* tp_hash */
(
hashfunc
)
string_hash
,
/* tp_hash */
...
@@ -3199,7 +3218,8 @@ PyTypeObject PyString_Type = {
...
@@ -3199,7 +3218,8 @@ PyTypeObject PyString_Type = {
PyObject_GenericGetAttr
,
/* tp_getattro */
PyObject_GenericGetAttr
,
/* tp_getattro */
0
,
/* tp_setattro */
0
,
/* tp_setattro */
&
string_as_buffer
,
/* tp_as_buffer */
&
string_as_buffer
,
/* tp_as_buffer */
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_BASETYPE
,
/* tp_flags */
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_CHECKTYPES
|
Py_TPFLAGS_BASETYPE
,
/* tp_flags */
string_doc
,
/* tp_doc */
string_doc
,
/* tp_doc */
0
,
/* tp_traverse */
0
,
/* tp_traverse */
0
,
/* tp_clear */
0
,
/* tp_clear */
...
...
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