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
23ab1016
Kaydet (Commit)
23ab1016
authored
Ock 18, 2011
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reword the OrderedDict entry to emphasize the default behavior,
to show equivalent code, and to provide a use case.
üst
ad62b039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
3.2.rst
Doc/whatsnew/3.2.rst
+12
-10
No files found.
Doc/whatsnew/3.2.rst
Dosyayı görüntüle @
23ab1016
...
...
@@ -798,19 +798,21 @@ collections
* The :class:`collections.OrderedDict` class has a new method
:meth:`~collections.OrderedDict.move_to_end` which takes an existing key and
moves it to either the beginning or end of an ordered sequence. When the
dictionary sequence is being used as a queue, these operations correspond to
"move to the front of the line" or "move to the back of the line":
moves it to either the first or last position in the ordered sequence.
The default is to move an item to the last position. This is equivalent of
renewing an entry with ``od[k] = od.pop(k)``.
A fast move-to-end operation is useful for resequencing entries. For example,
an ordered dictionary can being used to track access order by aging entries
from oldest to most recently accessed.
>>> d = OrderedDict.fromkeys(['a', 'b', 'X', 'd', 'e'])
>>> list(d)
['a', 'b', 'X', 'd', 'e']
>>> d.move_to_end('X'
, last=True
)
>>> d.move_to_end('X')
>>> list(d)
['a', 'b', 'd', 'e', 'X']
>>> d.move_to_end('X', last=False)
>>> list(d)
['X', 'a', 'b', 'd', 'e']
(Contributed by Raymond Hettinger.)
...
...
@@ -1683,11 +1685,11 @@ The :mod:`os` module has two new functions: :func:`~os.fsencode` and
:data:`os.environ`, :func:`os.getenvb` function and
:data:`os.supports_bytes_environ` constant.
``'mbcs'``
encoding doesn't ignore the error handler argument any more. By
MBCS
encoding doesn't ignore the error handler argument any more. By
default (strict mode), it raises an UnicodeDecodeError on undecodable byte
sequence and UnicodeEncodeError on unencodable character. To get the
``'mbcs'``
sequence and UnicodeEncodeError on unencodable character. To get the
MBCS
encoding of Python 3.1, use ``'ignore'`` error handler to decode and
``'replace'`` error handler to encode.
``'mbcs'``
supports ``'strict'`` and
``'replace'`` error handler to encode.
The MBCS codec
supports ``'strict'`` and
``'ignore'`` error handlers for decoding, and ``'strict'`` and ``'replace'``
for encoding.
...
...
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