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
e89b8e98
Kaydet (Commit)
e89b8e98
authored
Mar 03, 2009
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Backport 70111: Let configparser use ordered dicts by default.
üst
88a9164c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
configparser.rst
Doc/library/configparser.rst
+17
-0
ConfigParser.py
Lib/ConfigParser.py
+7
-1
NEWS
Misc/NEWS
+2
-0
No files found.
Doc/library/configparser.rst
Dosyayı görüntüle @
e89b8e98
...
...
@@ -75,6 +75,9 @@ write-back, as will be the keys within each section.
.. versionchanged:: 2.6
*dict_type* was added.
.. versionchanged:: 2.7
The default *dict_type* is :class:`collections.OrderedDict`.
.. class:: ConfigParser([defaults[, dict_type]])
...
...
@@ -91,6 +94,14 @@ write-back, as will be the keys within each section.
option names to lower case), the values ``foo %(bar)s`` and ``foo %(BAR)s`` are
equivalent.
.. versionadded:: 2.3
.. versionchanged:: 2.6
*dict_type* was added.
.. versionchanged:: 2.7
The default *dict_type* is :class:`collections.OrderedDict`.
.. class:: SafeConfigParser([defaults[, dict_type]])
...
...
@@ -103,6 +114,12 @@ write-back, as will be the keys within each section.
.. versionadded:: 2.3
.. versionchanged:: 2.6
*dict_type* was added.
.. versionchanged:: 2.7
The default *dict_type* is :class:`collections.OrderedDict`.
.. exception:: NoSectionError
...
...
Lib/ConfigParser.py
Dosyayı görüntüle @
e89b8e98
...
...
@@ -87,6 +87,12 @@ ConfigParser -- responsible for parsing a list of
write the configuration state in .ini format
"""
try
:
from
collections
import
OrderedDict
as
_default_dict
except
ImportError
:
# fallback for setup.py which hasn't yet built _collections
_default_dict
=
dict
import
re
__all__
=
[
"NoSectionError"
,
"DuplicateSectionError"
,
"NoOptionError"
,
...
...
@@ -215,7 +221,7 @@ class MissingSectionHeaderError(ParsingError):
class
RawConfigParser
:
def
__init__
(
self
,
defaults
=
None
,
dict_type
=
dict
):
def
__init__
(
self
,
defaults
=
None
,
dict_type
=
_default_
dict
):
self
.
_dict
=
dict_type
self
.
_sections
=
self
.
_dict
()
self
.
_defaults
=
self
.
_dict
()
...
...
Misc/NEWS
Dosyayı görüntüle @
e89b8e98
...
...
@@ -172,6 +172,8 @@ Library
- The _asdict() for method for namedtuples now returns an OrderedDict().
- The configparser module now defaults to using an ordered dictionary.
- Issue #4308: httplib.IncompleteRead's repr doesn't include all of the data all
ready received.
...
...
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