Skip to content

Commit

Permalink
Deploying to gh-pages from @ 9c5d9d8 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ken71301 committed May 4, 2024
1 parent 59037ec commit 5224e28
Show file tree
Hide file tree
Showing 530 changed files with 662 additions and 773 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 93845551cd222b0a9ba30766af7c01ea
config: 5f794947e626f64921f52723411e5c82
tags: 645f666f9bcd5a90fca523b33c5a78b7
6 changes: 4 additions & 2 deletions _sources/library/csv.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ The :mod:`csv` module defines the following classes:

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
dictionary preserves their original ordering.
fieldnames and will be omitted from the results. If
*fieldnames* is provided, they will be used and the first row will be
included in the results. 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
list and stored with the fieldname specified by *restkey* (which defaults
Expand Down
36 changes: 12 additions & 24 deletions _sources/library/itertools.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -818,10 +818,7 @@ and :term:`generators <generator>` which incur interpreter overhead.
return map(function, count(start))

def repeatfunc(func, times=None, *args):
"""Repeat calls to func with specified arguments.
Example: repeatfunc(random.random)
"""
"Repeat calls to func with specified arguments."
if times is None:
return starmap(func, repeat(args))
return starmap(func, repeat(args, times))
Expand All @@ -843,10 +840,8 @@ and :term:`generators <generator>` which incur interpreter overhead.
"Advance the iterator n-steps ahead. If n is None, consume entirely."
# Use functions that consume iterators at C speed.
if n is None:
# feed the entire iterator into a zero-length deque
collections.deque(iterator, maxlen=0)
else:
# advance to the empty slice starting at position n
next(islice(iterator, n, n), None)

def nth(iterable, n, default=None):
Expand All @@ -865,7 +860,7 @@ and :term:`generators <generator>` which incur interpreter overhead.

def all_equal(iterable, key=None):
"Returns True if all the elements are equal to each other."
# all_equal('4٤໔4৪', key=int) → True
# all_equal('4٤௪౪໔', key=int) → True
return len(take(2, groupby(iterable, key))) <= 1

def unique_justseen(iterable, key=None):
Expand Down Expand Up @@ -895,9 +890,9 @@ and :term:`generators <generator>` which incur interpreter overhead.
def sliding_window(iterable, n):
"Collect data into overlapping fixed-length chunks or blocks."
# sliding_window('ABCDEFG', 4) → ABCD BCDE CDEF DEFG
it = iter(iterable)
window = collections.deque(islice(it, n-1), maxlen=n)
for x in it:
iterator = iter(iterable)
window = collections.deque(islice(iterator, n - 1), maxlen=n)
for x in iterator:
window.append(x)
yield tuple(window)

Expand Down Expand Up @@ -947,8 +942,8 @@ and :term:`generators <generator>` which incur interpreter overhead.
seq_index = getattr(iterable, 'index', None)
if seq_index is None:
# Path for general iterables
it = islice(iterable, start, stop)
for i, element in enumerate(it, start):
iterator = islice(iterable, start, stop)
for i, element in enumerate(iterator, start):
if element is value or element == value:
yield i
else:
Expand All @@ -963,10 +958,7 @@ and :term:`generators <generator>` which incur interpreter overhead.
pass

def iter_except(func, exception, first=None):
""" Call a function repeatedly until an exception is raised.

Converts a call-until-exception interface to an iterator interface.
"""
"Convert a call-until-exception interface to an iterator interface."
# iter_except(d.popitem, KeyError) → non-blocking dictionary iterator
try:
if first is not None:
Expand Down Expand Up @@ -1066,14 +1058,10 @@ The following recipes have a more mathematical flavor:
# sieve(30) → 2 3 5 7 11 13 17 19 23 29
if n > 2:
yield 2
start = 3
data = bytearray((0, 1)) * (n // 2)
limit = math.isqrt(n) + 1
for p in iter_index(data, 1, start, limit):
yield from iter_index(data, 1, start, p*p)
for p in iter_index(data, 1, start=3, stop=math.isqrt(n) + 1):
data[p*p : n : p+p] = bytes(len(range(p*p, n, p+p)))
start = p*p
yield from iter_index(data, 1, start)
yield from iter_index(data, 1, start=3)

def factor(n):
"Prime factors of n."
Expand All @@ -1093,8 +1081,8 @@ The following recipes have a more mathematical flavor:
"Count of natural numbers up to n that are coprime to n."
# https://mathworld.wolfram.com/TotientFunction.html
# totient(12) → 4 because len([1, 5, 7, 11]) == 4
for p in unique_justseen(factor(n)):
n -= n // p
for prime in set(factor(n)):
n -= n // prime
return n


Expand Down
46 changes: 22 additions & 24 deletions _sources/library/typing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -842,14 +842,25 @@ using ``[]``.
.. versionadded:: 3.11

.. data:: Never
NoReturn

The `bottom type <https://en.wikipedia.org/wiki/Bottom_type>`_,
:data:`!Never` and :data:`!NoReturn` represent the
`bottom type <https://en.wikipedia.org/wiki/Bottom_type>`_,
a type that has no members.

This can be used to define a function that should never be
called, or a function that never returns::
They can be used to indicate that a function never returns,
such as :func:`sys.exit`::

from typing import Never
from typing import Never # or NoReturn

def stop() -> Never:
raise RuntimeError('no way')

Or to define a function that should never be
called, as there are no valid arguments, such as
:func:`assert_never`::

from typing import Never # or NoReturn

def never_call_me(arg: Never) -> None:
pass
Expand All @@ -862,31 +873,18 @@ using ``[]``.
case str():
print("It's a str")
case _:
never_call_me(arg) # OK, arg is of type Never

.. versionadded:: 3.11

On older Python versions, :data:`NoReturn` may be used to express the
same concept. ``Never`` was added to make the intended meaning more explicit.
never_call_me(arg) # OK, arg is of type Never (or NoReturn)

.. data:: NoReturn
:data:`!Never` and :data:`!NoReturn` have the same meaning in the type system
and static type checkers treat both equivalently.

Special type indicating that a function never returns.

For example::
.. versionadded:: 3.6.2

from typing import NoReturn
Added :data:`NoReturn`.

def stop() -> NoReturn:
raise RuntimeError('no way')

``NoReturn`` can also be used as a
`bottom type <https://en.wikipedia.org/wiki/Bottom_type>`_, a type that
has no values. Starting in Python 3.11, the :data:`Never` type should
be used for this concept instead. Type checkers should treat the two
equivalently.
.. versionadded:: 3.11

.. versionadded:: 3.6.2
Added :data:`Never`.

.. data:: Self

Expand Down
2 changes: 1 addition & 1 deletion about.html
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
4 changes: 2 additions & 2 deletions bugs.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
</section>
<section id="getting-started-contributing-to-python-yourself">
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
<p>除了只是回報您所發現的錯誤之外,同樣也歡迎您提交修正它們的修補程式 (patch)。您可以在 <a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果您有任何問題,<a class="reference external" href="https://devguide.python.org/">核心導師郵寄清單</a>是一個友善的地方,您可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
<p>除了只是回報您所發現的錯誤之外,同樣也歡迎您提交修正它們的修補程式 (patch)。您可以在 <a class="reference external" href="https://devguide.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果您有任何問題,<a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">核心導師郵寄清單</a>是一個友善的地方,您可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
</section>
</section>

Expand Down Expand Up @@ -441,7 +441,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/abstract.html
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/allocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/apiabiversion.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/arg.html
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/bool.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/bytearray.html
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/bytes.html
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/call.html
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/capsule.html
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/code.html
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/codec.html
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/complex.html
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/concrete.html
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/contextvars.html
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/conversion.html
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/coro.html
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/datetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/descriptor.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/dict.html
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 May 02, 2024 (19:45 UTC)。
最後更新於 May 04, 2024 (09:58 UTC)。

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

Expand Down
Loading

0 comments on commit 5224e28

Please sign in to comment.