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
9f3f0931
Kaydet (Commit)
9f3f0931
authored
Ock 31, 2019
tarafından
Michael Selik
Kaydeden (comit)
Raymond Hettinger
Ock 31, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34003: Use dict instead of OrderedDict in csv.DictReader (GH-8014)
üst
a1f9a333
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
csv.rst
Doc/library/csv.rst
+6
-6
csv.py
Lib/csv.py
+1
-2
2018-06-29-13-05-01.bpo-34003.Iu831h.rst
...S.d/next/Library/2018-06-29-13-05-01.bpo-34003.Iu831h.rst
+2
-0
No files found.
Doc/library/csv.rst
Dosyayı görüntüle @
9f3f0931
...
...
@@ -150,12 +150,12 @@ The :mod:`csv` module defines the following classes:
dialect='excel', *args, **kwds)
Create an object that operates like a regular reader but maps the
information in each row to a
n :mod:`OrderedDict <collections.OrderedDict>`
whose keys are given by the
optional *fieldnames* parameter.
information in each row to a
:class:`dict` whose keys are given by the
optional *fieldnames* parameter.
The *fieldnames* parameter is a :term:`sequence`. If *fieldnames* is
omitted, the values in the first row of file *f* will be used as the
fieldnames. Regardless of how the fieldnames are determined, the
ordered
fieldnames. Regardless of how the fieldnames are determined, the
dictionary preserves their original ordering.
If a row has more fields than fieldnames, the remaining data is put in a
...
...
@@ -166,8 +166,8 @@ The :mod:`csv` module defines the following classes:
All other optional or keyword arguments are passed to the underlying
:class:`reader` instance.
.. versionchanged:: 3.
6
Returned rows are now of type :class:`
OrderedD
ict`.
.. versionchanged:: 3.
8
Returned rows are now of type :class:`
d
ict`.
A short usage example::
...
...
@@ -181,7 +181,7 @@ The :mod:`csv` module defines the following classes:
John Cleese
>>> print(row)
OrderedDict([('first_name', 'John'), ('last_name', 'Cleese')])
{'first_name': 'John', 'last_name': 'Cleese'}
.. class:: DictWriter(f, fieldnames, restval='', extrasaction='raise', \
...
...
Lib/csv.py
Dosyayı görüntüle @
9f3f0931
...
...
@@ -11,7 +11,6 @@ from _csv import Error, __version__, writer, reader, register_dialect, \
__doc__
from
_csv
import
Dialect
as
_Dialect
from
collections
import
OrderedDict
from
io
import
StringIO
__all__
=
[
"QUOTE_MINIMAL"
,
"QUOTE_ALL"
,
"QUOTE_NONNUMERIC"
,
"QUOTE_NONE"
,
...
...
@@ -117,7 +116,7 @@ class DictReader:
# values
while
row
==
[]:
row
=
next
(
self
.
reader
)
d
=
OrderedD
ict
(
zip
(
self
.
fieldnames
,
row
))
d
=
d
ict
(
zip
(
self
.
fieldnames
,
row
))
lf
=
len
(
self
.
fieldnames
)
lr
=
len
(
row
)
if
lf
<
lr
:
...
...
Misc/NEWS.d/next/Library/2018-06-29-13-05-01.bpo-34003.Iu831h.rst
0 → 100644
Dosyayı görüntüle @
9f3f0931
csv.DictReader now creates dicts instead of OrderedDicts. Patch by Michael
Selik.
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