Skip to content

Commit

Permalink
Deploying to gh-pages from @ ff8005f 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwang44 committed Nov 9, 2023
1 parent 613cc29 commit 21bdc34
Show file tree
Hide file tree
Showing 529 changed files with 657 additions and 657 deletions.
9 changes: 7 additions & 2 deletions _sources/glossary.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,11 @@ Glossary
an :term:`expression` or one of several constructs with a keyword, such
as :keyword:`if`, :keyword:`while` or :keyword:`for`.

static type checker
An external tool that reads Python code and analyzes it, looking for
issues such as incorrect types. See also :term:`type hints <type hint>`
and the :mod:`typing` module.

strong reference
In Python's C API, a strong reference is a reference to an object
which is owned by the code holding the reference. The strong
Expand Down Expand Up @@ -1208,8 +1213,8 @@ Glossary
attribute, or a function parameter or return value.

Type hints are optional and are not enforced by Python but
they are useful to static type analysis tools, and aid IDEs with code
completion and refactoring.
they are useful to :term:`static type checkers <static type checker>`.
They can also aid IDEs with code completion and refactoring.

Type hints of global variables, class attributes, and functions,
but not local variables, can be accessed using
Expand Down
5 changes: 3 additions & 2 deletions _sources/howto/pyporting.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ are:
#. Once your dependencies are no longer blocking you, use continuous integration
to make sure you stay compatible with Python 2 and 3 (tox_ can help test
against multiple versions of Python; ``python -m pip install tox``)
#. Consider using optional static type checking to make sure your type usage
#. Consider using optional :term:`static type checking <static type checker>`
to make sure your type usage
works in both Python 2 and 3 (e.g. use mypy_ to check your typing under both
Python 2 and Python 3; ``python -m pip install mypy``).

Expand Down Expand Up @@ -395,7 +396,7 @@ comparisons occur, making the mistake much easier to track down.
Consider using optional static type checking
--------------------------------------------

Another way to help port your code is to use a static type checker like
Another way to help port your code is to use a :term:`static type checker` like
mypy_ or pytype_ on your code. These tools can be used to analyze your code as
if it's being run under Python 2, then you can run the tool a second time as if
your code is running under Python 3. By running a static type checker twice like
Expand Down
3 changes: 2 additions & 1 deletion _sources/library/datetime.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ on efficient attribute extraction for output formatting and manipulation.
Third-party library with expanded time zone and parsing support.

Package `DateType <https://pypi.org/project/datetype/>`_
Third-party library that introduces distinct static types to e.g. allow static type checkers
Third-party library that introduces distinct static types to e.g. allow
:term:`static type checkers <static type checker>`
to differentiate between naive and aware datetimes.

.. _datetime-naive-aware:
Expand Down
11 changes: 4 additions & 7 deletions _sources/library/typing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
.. note::

The Python runtime does not enforce function and variable type annotations.
They can be used by third party tools such as type checkers, IDEs, linters,
etc.
They can be used by third party tools such as :term:`type checkers <static type checker>`,
IDEs, linters, etc.

--------------

Expand Down Expand Up @@ -1135,16 +1135,13 @@ These can be used as types in annotations. They all support subscription using

from collections.abc import Callable
from threading import Lock
from typing import Concatenate, ParamSpec, TypeVar

P = ParamSpec('P')
R = TypeVar('R')
from typing import Concatenate

# Use this lock to ensure that only one thread is executing a function
# at any time.
my_lock = Lock()

def with_lock(f: Callable[Concatenate[Lock, P], R]) -> Callable[P, R]:
def with_lock[**P, R](f: Callable[Concatenate[Lock, P], R]) -> Callable[P, R]:
'''A type-safe decorator which provides a lock.'''
def inner(*args: P.args, **kwargs: P.kwargs) -> R:
# Provide the lock as the first argument.
Expand Down
2 changes: 1 addition & 1 deletion _static/glossary.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion about.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
4 changes: 2 additions & 2 deletions bugs.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,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="Link to this heading"></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 @@ -344,7 +344,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/abstract.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/allocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/apiabiversion.html
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/arg.html
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/bool.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/bytearray.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/bytes.html
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/call.html
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/capsule.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/code.html
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/codec.html
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/complex.html
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/concrete.html
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/contextvars.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/conversion.html
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/coro.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/datetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/descriptor.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/dict.html
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/exceptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/file.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/float.html
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/function.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/gcsupport.html
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/gen.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/init.html
Original file line number Diff line number Diff line change
Expand Up @@ -2469,7 +2469,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
2 changes: 1 addition & 1 deletion c-api/init_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@ <h3>瀏覽</h3>
<br />
<br />

最後更新於 11月 06, 2023。
最後更新於 11月 09, 2023。
<a href="/bugs.html">Found a bug</a>?
<br />

Expand Down
Loading

0 comments on commit 21bdc34

Please sign in to comment.