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
5725d1eb
Kaydet (Commit)
5725d1eb
authored
Kas 30, 2000
tarafından
Moshe Zadka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Backing out my changes.
Improved version coming soon to a Source Forge near you!
üst
1221e6df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
90 deletions
+0
-90
libstdtypes.tex
Doc/lib/libstdtypes.tex
+0
-12
test_types.py
Lib/test/test_types.py
+0
-6
dictobject.c
Objects/dictobject.c
+0
-72
No files found.
Doc/lib/libstdtypes.tex
Dosyayı görüntüle @
5725d1eb
...
@@ -783,12 +783,8 @@ arbitrary objects):
...
@@ -783,12 +783,8 @@ arbitrary objects):
\ttindex
{
has
_
key()
}
\ttindex
{
has
_
key()
}
\ttindex
{
items()
}
\ttindex
{
items()
}
\ttindex
{
keys()
}
\ttindex
{
keys()
}
\ttindex
{
firstitem()
}
\ttindex
{
firstkey()
}
\ttindex
{
update()
}
\ttindex
{
update()
}
\ttindex
{
values()
}
\ttindex
{
values()
}
\ttindex
{
firstvalue()
}
\ttindex
{
setdefault()
}
\ttindex
{
get()
}}
\ttindex
{
get()
}}
\begin{tableiii}
{
c|l|c
}{
code
}{
Operation
}{
Result
}{
Notes
}
\begin{tableiii}
{
c|l|c
}{
code
}{
Operation
}{
Result
}{
Notes
}
...
@@ -808,19 +804,11 @@ arbitrary objects):
...
@@ -808,19 +804,11 @@ arbitrary objects):
\lineiii
{
\var
{
a
}
.items()
}
\lineiii
{
\var
{
a
}
.items()
}
{
a copy of
\var
{
a
}
's list of (
\var
{
key
}
,
\var
{
value
}
) pairs
}
{
a copy of
\var
{
a
}
's list of (
\var
{
key
}
,
\var
{
value
}
) pairs
}
{
(2)
}
{
(2)
}
\lineiii
{
\var
{
a
}
.firstitem()
}
{
a (
\var
{
key
}
,
\var
{
value
}
) pair, the first one in
\var
{
a
}
.items()
}
{
(2)
}
\lineiii
{
\var
{
a
}
.keys()
}{
a copy of
\var
{
a
}
's list of keys
}{
(2)
}
\lineiii
{
\var
{
a
}
.keys()
}{
a copy of
\var
{
a
}
's list of keys
}{
(2)
}
\lineiii
{
\var
{
a
}
.firstkey()
}
{
the first element in
\var
{
a
}
.keys()
}
{
(2)
}
\lineiii
{
\var
{
a
}
.update(
\var
{
b
}
)
}
\lineiii
{
\var
{
a
}
.update(
\var
{
b
}
)
}
{
\code
{
for k in
\var
{
b
}
.keys():
\var
{
a
}
[k] =
\var
{
b
}
[k]
}}
{
\code
{
for k in
\var
{
b
}
.keys():
\var
{
a
}
[k] =
\var
{
b
}
[k]
}}
{
(3)
}
{
(3)
}
\lineiii
{
\var
{
a
}
.values()
}{
a copy of
\var
{
a
}
's list of values
}{
(2)
}
\lineiii
{
\var
{
a
}
.values()
}{
a copy of
\var
{
a
}
's list of values
}{
(2)
}
\lineiii
{
\var
{
a
}
.firstvalue()
}
{
the first element in
\var
{
a
}
.values()
}
\lineiii
{
\var
{
a
}
.get(
\var
{
k
}
\optional
{
,
\var
{
x
}}
)
}
\lineiii
{
\var
{
a
}
.get(
\var
{
k
}
\optional
{
,
\var
{
x
}}
)
}
{
\code
{
\var
{
a
}
[
\var
{
k
}
]
}
if
\code
{
\var
{
a
}
.has
_
key(
\var
{
k
}
)
}
,
{
\code
{
\var
{
a
}
[
\var
{
k
}
]
}
if
\code
{
\var
{
a
}
.has
_
key(
\var
{
k
}
)
}
,
else
\var
{
x
}}
else
\var
{
x
}}
...
...
Lib/test/test_types.py
Dosyayı görüntüle @
5725d1eb
...
@@ -265,9 +265,3 @@ if d['key'][0] <> 3:
...
@@ -265,9 +265,3 @@ if d['key'][0] <> 3:
d
.
setdefault
(
'key'
,
[])
.
append
(
4
)
d
.
setdefault
(
'key'
,
[])
.
append
(
4
)
if
len
(
d
[
'key'
])
<>
2
:
if
len
(
d
[
'key'
])
<>
2
:
raise
TestFailed
,
'present {} setdefault, w/ 2nd arg'
raise
TestFailed
,
'present {} setdefault, w/ 2nd arg'
if
d
.
keys
()[
0
]
!=
d
.
firstkey
():
raise
TestFailed
,
'first key is not first in keys'
if
d
.
values
()[
0
]
!=
d
.
firstvalue
():
raise
TestFailed
,
'first value is not first in values'
if
d
.
items
()[
0
]
!=
d
.
firstitem
():
raise
TestFailed
,
'first item is not first in items'
Objects/dictobject.c
Dosyayı görüntüle @
5725d1eb
...
@@ -708,75 +708,6 @@ static PyMappingMethods dict_as_mapping = {
...
@@ -708,75 +708,6 @@ static PyMappingMethods dict_as_mapping = {
(
objobjargproc
)
dict_ass_sub
,
/*mp_ass_subscript*/
(
objobjargproc
)
dict_ass_sub
,
/*mp_ass_subscript*/
};
};
static
PyObject
*
dict_firstkey
(
register
dictobject
*
mp
,
PyObject
*
args
)
{
register
int
i
;
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
if
(
mp
->
ma_used
==
0
)
{
PyErr_SetString
(
PyExc_ValueError
,
"empty dictionary"
);
return
NULL
;
}
for
(
i
=
0
;
i
<
mp
->
ma_size
;
i
++
)
{
if
(
mp
->
ma_table
[
i
].
me_value
!=
NULL
)
{
PyObject
*
key
=
mp
->
ma_table
[
i
].
me_key
;
Py_INCREF
(
key
);
return
key
;
}
}
}
static
PyObject
*
dict_firstvalue
(
register
dictobject
*
mp
,
PyObject
*
args
)
{
register
int
i
;
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
if
(
mp
->
ma_used
==
0
)
{
PyErr_SetString
(
PyExc_ValueError
,
"empty dictionary"
);
return
NULL
;
}
for
(
i
=
0
;
i
<
mp
->
ma_size
;
i
++
)
{
if
(
mp
->
ma_table
[
i
].
me_value
!=
NULL
)
{
PyObject
*
value
=
mp
->
ma_table
[
i
].
me_value
;
Py_INCREF
(
value
);
return
value
;
}
}
}
static
PyObject
*
dict_firstitem
(
register
dictobject
*
mp
,
PyObject
*
args
)
{
register
int
i
;
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
if
(
mp
->
ma_used
==
0
)
{
PyErr_SetString
(
PyExc_ValueError
,
"empty dictionary"
);
return
NULL
;
}
for
(
i
=
0
;
i
<
mp
->
ma_size
;
i
++
)
{
if
(
mp
->
ma_table
[
i
].
me_value
!=
NULL
)
{
PyObject
*
key
=
mp
->
ma_table
[
i
].
me_key
;
PyObject
*
value
=
mp
->
ma_table
[
i
].
me_value
;
PyObject
*
item
=
PyTuple_New
(
2
);
if
(
item
==
NULL
)
{
return
NULL
;
}
Py_INCREF
(
key
);
PyTuple_SetItem
(
item
,
0
,
key
);
Py_INCREF
(
value
);
PyTuple_SetItem
(
item
,
1
,
value
);
return
item
;
}
}
}
static
PyObject
*
static
PyObject
*
dict_keys
(
register
dictobject
*
mp
,
PyObject
*
args
)
dict_keys
(
register
dictobject
*
mp
,
PyObject
*
args
)
{
{
...
@@ -1231,9 +1162,6 @@ static PyMethodDef mapp_methods[] = {
...
@@ -1231,9 +1162,6 @@ static PyMethodDef mapp_methods[] = {
{
"keys"
,
(
PyCFunction
)
dict_keys
},
{
"keys"
,
(
PyCFunction
)
dict_keys
},
{
"items"
,
(
PyCFunction
)
dict_items
},
{
"items"
,
(
PyCFunction
)
dict_items
},
{
"values"
,
(
PyCFunction
)
dict_values
},
{
"values"
,
(
PyCFunction
)
dict_values
},
{
"firstkey"
,
(
PyCFunction
)
dict_firstkey
},
{
"firstitem"
,
(
PyCFunction
)
dict_firstitem
},
{
"firstvalue"
,
(
PyCFunction
)
dict_firstvalue
},
{
"update"
,
(
PyCFunction
)
dict_update
},
{
"update"
,
(
PyCFunction
)
dict_update
},
{
"clear"
,
(
PyCFunction
)
dict_clear
},
{
"clear"
,
(
PyCFunction
)
dict_clear
},
{
"copy"
,
(
PyCFunction
)
dict_copy
},
{
"copy"
,
(
PyCFunction
)
dict_copy
},
...
...
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