Skip to content

Commit 30f72ee

Browse files
committed
Deploying to gh-pages from @ 1a30c43 🚀
1 parent c698d13 commit 30f72ee

File tree

529 files changed

+559
-542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

529 files changed

+559
-542
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 245d3ca516eb8b760ee179bdc9c9e27a
3+
config: b5f2ce9acaa5f47f79bb65a7af64d2e7
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/library/itertools.rst.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,15 +849,15 @@ and :term:`generators <generator>` which incur interpreter overhead.
849849
return len(take(2, groupby(iterable, key))) <= 1
850850

851851
def unique_justseen(iterable, key=None):
852-
"List unique elements, preserving order. Remember only the element just seen."
852+
"Yield unique elements, preserving order. Remember only the element just seen."
853853
# unique_justseen('AAAABBBCCDAABBB') → A B C D A B
854854
# unique_justseen('ABBcCAD', str.casefold) → A B c A D
855855
if key is None:
856856
return map(operator.itemgetter(0), groupby(iterable))
857857
return map(next, map(operator.itemgetter(1), groupby(iterable, key)))
858858

859859
def unique_everseen(iterable, key=None):
860-
"List unique elements, preserving order. Remember all elements ever seen."
860+
"Yield unique elements, preserving order. Remember all elements ever seen."
861861
# unique_everseen('AAAABBBCCDAABBB') → A B C D
862862
# unique_everseen('ABBcCAD', str.casefold) → A B c D
863863
seen = set()
@@ -872,6 +872,11 @@ and :term:`generators <generator>` which incur interpreter overhead.
872872
seen.add(k)
873873
yield element
874874

875+
def unique(iterable, key=None, reverse=False):
876+
"Yield unique elements in sorted order. Supports unhashable inputs."
877+
# unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]
878+
return unique_justseen(sorted(iterable, key=key, reverse=reverse), key=key)
879+
875880
def sliding_window(iterable, n):
876881
"Collect data into overlapping fixed-length chunks or blocks."
877882
# sliding_window('ABCDEFG', 4) → ABCD BCDE CDEF DEFG
@@ -1593,6 +1598,13 @@ The following recipes have a more mathematical flavor:
15931598
>>> ''.join(input_iterator)
15941599
'AAABBBCCDAABBB'
15951600

1601+
>>> list(unique([[1, 2], [3, 4], [1, 2]]))
1602+
[[1, 2], [3, 4]]
1603+
>>> list(unique('ABBcCAD', str.casefold))
1604+
['A', 'B', 'c', 'D']
1605+
>>> list(unique('ABBcCAD', str.casefold, reverse=True))
1606+
['D', 'c', 'B', 'A']
1607+
15961608
>>> d = dict(a=1, b=2, c=3)
15971609
>>> it = iter_except(d.popitem, KeyError)
15981610
>>> d['d'] = 4

_sources/tutorial/classes.rst.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,7 @@ code will print the value ``16``, without leaving a trace::
338338
del x.counter
339339

340340
The other kind of instance attribute reference is a *method*. A method is a
341-
function that "belongs to" an object. (In Python, the term method is not unique
342-
to class instances: other object types can have methods as well. For example,
343-
list objects have methods called append, insert, remove, sort, and so on.
344-
However, in the following discussion, we'll use the term method exclusively to
345-
mean methods of class instance objects, unless explicitly stated otherwise.)
341+
function that "belongs to" an object.
346342

347343
.. index:: pair: object; method
348344

about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ <h3>瀏覽</h3>
401401
<a href="https://www.python.org/psf/donations/">Please donate.</a>
402402
<br />
403403
<br />
404-
最後更新於 Jun 01, 2024 (08:45 UTC)。
404+
最後更新於 Jun 02, 2024 (14:44 UTC)。
405405

406406
<a href="/bugs.html">Found a bug</a>?
407407

bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ <h3>瀏覽</h3>
440440
<a href="https://www.python.org/psf/donations/">Please donate.</a>
441441
<br />
442442
<br />
443-
最後更新於 Jun 01, 2024 (08:45 UTC)。
443+
最後更新於 Jun 02, 2024 (14:44 UTC)。
444444

445445
<a href="/bugs.html">Found a bug</a>?
446446

c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ <h3>瀏覽</h3>
411411
<a href="https://www.python.org/psf/donations/">Please donate.</a>
412412
<br />
413413
<br />
414-
最後更新於 Jun 01, 2024 (08:45 UTC)。
414+
最後更新於 Jun 02, 2024 (14:44 UTC)。
415415

416416
<a href="/bugs.html">Found a bug</a>?
417417

c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ <h3>瀏覽</h3>
425425
<a href="https://www.python.org/psf/donations/">Please donate.</a>
426426
<br />
427427
<br />
428-
最後更新於 Jun 01, 2024 (08:45 UTC)。
428+
最後更新於 Jun 02, 2024 (14:44 UTC)。
429429

430430
<a href="/bugs.html">Found a bug</a>?
431431

c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ <h3>瀏覽</h3>
457457
<a href="https://www.python.org/psf/donations/">Please donate.</a>
458458
<br />
459459
<br />
460-
最後更新於 Jun 01, 2024 (08:45 UTC)。
460+
最後更新於 Jun 02, 2024 (14:44 UTC)。
461461

462462
<a href="/bugs.html">Found a bug</a>?
463463

c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ <h3>瀏覽</h3>
968968
<a href="https://www.python.org/psf/donations/">Please donate.</a>
969969
<br />
970970
<br />
971-
最後更新於 Jun 01, 2024 (08:45 UTC)。
971+
最後更新於 Jun 02, 2024 (14:44 UTC)。
972972

973973
<a href="/bugs.html">Found a bug</a>?
974974

c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ <h3>瀏覽</h3>
422422
<a href="https://www.python.org/psf/donations/">Please donate.</a>
423423
<br />
424424
<br />
425-
最後更新於 Jun 01, 2024 (08:45 UTC)。
425+
最後更新於 Jun 02, 2024 (14:44 UTC)。
426426

427427
<a href="/bugs.html">Found a bug</a>?
428428

0 commit comments

Comments
 (0)