Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d224c95

Browse files
committed
Deploying to gh-pages from @ cc5597f 🚀
1 parent 27d9921 commit d224c95

File tree

560 files changed

+4872
-4794
lines changed

Some content is hidden

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

560 files changed

+4872
-4794
lines changed

_sources/c-api/init.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
203203

204204
Set by the :option:`-i` option.
205205

206-
.. deprecated:: 3.12
206+
.. deprecated-removed:: 3.12 3.15
207207

208208
.. c:var:: int Py_IsolatedFlag
209209

_sources/library/html.parser.rst.txt

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ Example HTML Parser Application
4343

4444
As a basic example, below is a simple HTML parser that uses the
4545
:class:`HTMLParser` class to print out start tags, end tags, and data
46-
as they are encountered::
46+
as they are encountered:
47+
48+
.. testcode::
4749

4850
from html.parser import HTMLParser
4951

@@ -63,7 +65,7 @@ as they are encountered::
6365

6466
The output will then be:
6567

66-
.. code-block:: none
68+
.. testoutput::
6769

6870
Encountered a start tag: html
6971
Encountered a start tag: head
@@ -230,7 +232,9 @@ Examples
230232
--------
231233

232234
The following class implements a parser that will be used to illustrate more
233-
examples::
235+
examples:
236+
237+
.. testcode::
234238

235239
from html.parser import HTMLParser
236240
from html.entities import name2codepoint
@@ -266,13 +270,17 @@ examples::
266270

267271
parser = MyHTMLParser()
268272

269-
Parsing a doctype::
273+
Parsing a doctype:
274+
275+
.. doctest::
270276

271277
>>> parser.feed('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" '
272278
... '"http://www.w3.org/TR/html4/strict.dtd">')
273279
Decl : DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"
274280

275-
Parsing an element with a few attributes and a title::
281+
Parsing an element with a few attributes and a title:
282+
283+
.. doctest::
276284

277285
>>> parser.feed('<img src="python-logo.png" alt="The Python logo">')
278286
Start tag: img
@@ -285,7 +293,9 @@ Parsing an element with a few attributes and a title::
285293
End tag : h1
286294

287295
The content of ``script`` and ``style`` elements is returned as is, without
288-
further parsing::
296+
further parsing:
297+
298+
.. doctest::
289299

290300
>>> parser.feed('<style type="text/css">#python { color: green }</style>')
291301
Start tag: style
@@ -300,35 +310,48 @@ further parsing::
300310
Data : alert("<strong>hello!</strong>");
301311
End tag : script
302312

303-
Parsing comments::
313+
Parsing comments:
314+
315+
.. doctest::
304316

305-
>>> parser.feed('<!-- a comment -->'
317+
>>> parser.feed('<!--a comment-->'
306318
... '<!--[if IE 9]>IE-specific content<![endif]-->')
307-
Comment : a comment
319+
Comment : a comment
308320
Comment : [if IE 9]>IE-specific content<![endif]
309321

310322
Parsing named and numeric character references and converting them to the
311-
correct char (note: these 3 references are all equivalent to ``'>'``)::
323+
correct char (note: these 3 references are all equivalent to ``'>'``):
312324

325+
.. doctest::
326+
327+
>>> parser = MyHTMLParser()
328+
>>> parser.feed('&gt;&#62;&#x3E;')
329+
Data : >>>
330+
331+
>>> parser = MyHTMLParser(convert_charrefs=False)
313332
>>> parser.feed('&gt;&#62;&#x3E;')
314333
Named ent: >
315334
Num ent : >
316335
Num ent : >
317336

318337
Feeding incomplete chunks to :meth:`~HTMLParser.feed` works, but
319338
:meth:`~HTMLParser.handle_data` might be called more than once
320-
(unless *convert_charrefs* is set to ``True``)::
339+
(unless *convert_charrefs* is set to ``True``):
321340

322-
>>> for chunk in ['<sp', 'an>buff', 'ered ', 'text</s', 'pan>']:
341+
.. doctest::
342+
343+
>>> for chunk in ['<sp', 'an>buff', 'ered', ' text</s', 'pan>']:
323344
... parser.feed(chunk)
324345
...
325346
Start tag: span
326347
Data : buff
327348
Data : ered
328-
Data : text
349+
Data : text
329350
End tag : span
330351

331-
Parsing invalid HTML (e.g. unquoted attributes) also works::
352+
Parsing invalid HTML (e.g. unquoted attributes) also works:
353+
354+
.. doctest::
332355

333356
>>> parser.feed('<p><a class=link href=#main>tag soup</p ></a>')
334357
Start tag: p

_sources/library/stdtypes.rst.txt

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ expression support in the :mod:`re` module).
18761876

18771877
.. method:: str.isprintable()
18781878

1879-
Return true if all characters in the string are printable, false if it
1879+
Return ``True`` if all characters in the string are printable, ``False`` if it
18801880
contains at least one non-printable character.
18811881

18821882
Here "printable" means the character is suitable for :func:`repr` to use in
@@ -4629,7 +4629,13 @@ can be used interchangeably to index the same dictionary entry.
46294629
being added is already present, the value from the keyword argument
46304630
replaces the value from the positional argument.
46314631

4632-
To illustrate, the following examples all return a dictionary equal to
4632+
Providing keyword arguments as in the first example only works for keys that
4633+
are valid Python identifiers. Otherwise, any valid keys can be used.
4634+
4635+
Dictionaries compare equal if and only if they have the same ``(key,
4636+
value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', '>') raise
4637+
:exc:`TypeError`. To illustrate dictionary creation and equality,
4638+
the following examples all return a dictionary equal to
46334639
``{"one": 1, "two": 2, "three": 3}``::
46344640

46354641
>>> a = dict(one=1, two=2, three=3)
@@ -4644,6 +4650,27 @@ can be used interchangeably to index the same dictionary entry.
46444650
Providing keyword arguments as in the first example only works for keys that
46454651
are valid Python identifiers. Otherwise, any valid keys can be used.
46464652

4653+
Dictionaries preserve insertion order. Note that updating a key does not
4654+
affect the order. Keys added after deletion are inserted at the end. ::
4655+
4656+
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
4657+
>>> d
4658+
{'one': 1, 'two': 2, 'three': 3, 'four': 4}
4659+
>>> list(d)
4660+
['one', 'two', 'three', 'four']
4661+
>>> list(d.values())
4662+
[1, 2, 3, 4]
4663+
>>> d["one"] = 42
4664+
>>> d
4665+
{'one': 42, 'two': 2, 'three': 3, 'four': 4}
4666+
>>> del d["two"]
4667+
>>> d["two"] = None
4668+
>>> d
4669+
{'one': 42, 'three': 3, 'four': 4, 'two': None}
4670+
4671+
.. versionchanged:: 3.7
4672+
Dictionary order is guaranteed to be insertion order. This behavior was
4673+
an implementation detail of CPython from 3.6.
46474674

46484675
These are the operations that dictionaries support (and therefore, custom
46494676
mapping types should support too):
@@ -4814,32 +4841,6 @@ can be used interchangeably to index the same dictionary entry.
48144841

48154842
.. versionadded:: 3.9
48164843

4817-
Dictionaries compare equal if and only if they have the same ``(key,
4818-
value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', '>') raise
4819-
:exc:`TypeError`.
4820-
4821-
Dictionaries preserve insertion order. Note that updating a key does not
4822-
affect the order. Keys added after deletion are inserted at the end. ::
4823-
4824-
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
4825-
>>> d
4826-
{'one': 1, 'two': 2, 'three': 3, 'four': 4}
4827-
>>> list(d)
4828-
['one', 'two', 'three', 'four']
4829-
>>> list(d.values())
4830-
[1, 2, 3, 4]
4831-
>>> d["one"] = 42
4832-
>>> d
4833-
{'one': 42, 'two': 2, 'three': 3, 'four': 4}
4834-
>>> del d["two"]
4835-
>>> d["two"] = None
4836-
>>> d
4837-
{'one': 42, 'three': 3, 'four': 4, 'two': None}
4838-
4839-
.. versionchanged:: 3.7
4840-
Dictionary order is guaranteed to be insertion order. This behavior was
4841-
an implementation detail of CPython from 3.6.
4842-
48434844
Dictionaries and dictionary views are reversible. ::
48444845

48454846
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}

_sources/library/string.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ these rules. The methods of :class:`Template` are:
845845

846846
.. method:: is_valid()
847847

848-
Returns false if the template has invalid placeholders that will cause
848+
Returns ``False`` if the template has invalid placeholders that will cause
849849
:meth:`substitute` to raise :exc:`ValueError`.
850850

851851
.. versionadded:: 3.11

_sources/reference/lexical_analysis.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ which is recognized by Bram Moolenaar's VIM.
9999

100100
If no encoding declaration is found, the default encoding is UTF-8. If the
101101
implicit or explicit encoding of a file is UTF-8, an initial UTF-8 byte-order
102-
mark (b'\xef\xbb\xbf') is ignored rather than being a syntax error.
102+
mark (``b'\xef\xbb\xbf'``) is ignored rather than being a syntax error.
103103

104104
If an encoding is declared, the encoding name must be recognized by Python
105105
(see :ref:`standard-encodings`). The

_sources/tutorial/introduction.rst.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ Python can manipulate text (represented by type :class:`str`, so-called
147147
"``Yay! :)``". They can be enclosed in single quotes (``'...'``) or double
148148
quotes (``"..."``) with the same result [#]_.
149149

150+
.. code-block:: pycon
151+
150152
>>> 'spam eggs' # single quotes
151153
'spam eggs'
152154
>>> "Paris rabbit got your back :)! Yay!" # double quotes

_sources/using/cmdline.rst.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,14 @@ conflict.
12291229

12301230
.. versionadded:: 3.13
12311231

1232+
.. envvar:: PYTHON_JIT
1233+
1234+
On builds where experimental just-in-time compilation is available, this
1235+
variable can force the JIT to be disabled (``0``) or enabled (``1``) at
1236+
interpreter startup.
1237+
1238+
.. versionadded:: 3.13
1239+
12321240
Debug-mode variables
12331241
~~~~~~~~~~~~~~~~~~~~
12341242

_sources/whatsnew/3.13.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,11 @@ without the optional value.
390390

391391
* ``no``: Disable the entire Tier 2 and JIT pipeline.
392392
* ``yes``: Enable the JIT.
393-
To disable the JIT at runtime, pass the environment variable ``PYTHON_JIT=0``.
393+
To disable the JIT at runtime, pass the environment variable :envvar:`PYTHON_JIT=0 <PYTHON_JIT>`.
394394
* ``yes-off``: Build the JIT but disable it by default.
395-
To enable the JIT at runtime, pass the environment variable ``PYTHON_JIT=1``.
395+
To enable the JIT at runtime, pass the environment variable :envvar:`PYTHON_JIT=1 <PYTHON_JIT>`.
396396
* ``interpreter``: Enable the Tier 2 interpreter but disable the JIT.
397-
The interpreter can be disabled by running with ``PYTHON_JIT=0``.
397+
The interpreter can be disabled by running with :envvar:`PYTHON_JIT=0 <PYTHON_JIT>`.
398398

399399
The internal architecture is roughly as follows:
400400

about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ <h3>瀏覽</h3>
320320
<a href="https://www.python.org/psf/donations/">Please donate.</a>
321321
<br>
322322
<br>
323-
最後更新於 5月 06, 2025 (05:50 UTC)。
323+
最後更新於 5月 10, 2025 (02:38 UTC)。
324324

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

bugs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
231231
</section>
232232
<section id="getting-started-contributing-to-python-yourself">
233233
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
234-
<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>
234+
<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>
235235
</section>
236236
</section>
237237

@@ -359,7 +359,7 @@ <h3>瀏覽</h3>
359359
<a href="https://www.python.org/psf/donations/">Please donate.</a>
360360
<br>
361361
<br>
362-
最後更新於 5月 06, 2025 (05:50 UTC)。
362+
最後更新於 5月 10, 2025 (02:38 UTC)。
363363

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

c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ <h3>瀏覽</h3>
329329
<a href="https://www.python.org/psf/donations/">Please donate.</a>
330330
<br>
331331
<br>
332-
最後更新於 5月 06, 2025 (05:50 UTC)。
332+
最後更新於 5月 10, 2025 (02:38 UTC)。
333333

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

c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ <h3>瀏覽</h3>
350350
<a href="https://www.python.org/psf/donations/">Please donate.</a>
351351
<br>
352352
<br>
353-
最後更新於 5月 06, 2025 (05:50 UTC)。
353+
最後更新於 5月 10, 2025 (02:38 UTC)。
354354

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

c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>瀏覽</h3>
376376
<a href="https://www.python.org/psf/donations/">Please donate.</a>
377377
<br>
378378
<br>
379-
最後更新於 5月 06, 2025 (05:50 UTC)。
379+
最後更新於 5月 10, 2025 (02:38 UTC)。
380380

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

c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ <h3>瀏覽</h3>
931931
<a href="https://www.python.org/psf/donations/">Please donate.</a>
932932
<br>
933933
<br>
934-
最後更新於 5月 06, 2025 (05:50 UTC)。
934+
最後更新於 5月 10, 2025 (02:38 UTC)。
935935

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

c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ <h3>瀏覽</h3>
341341
<a href="https://www.python.org/psf/donations/">Please donate.</a>
342342
<br>
343343
<br>
344-
最後更新於 5月 06, 2025 (05:50 UTC)。
344+
最後更新於 5月 10, 2025 (02:38 UTC)。
345345

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

c-api/buffer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ <h3>瀏覽</h3>
10221022
<a href="https://www.python.org/psf/donations/">Please donate.</a>
10231023
<br>
10241024
<br>
1025-
最後更新於 5月 06, 2025 (05:50 UTC)。
1025+
最後更新於 5月 10, 2025 (02:38 UTC)。
10261026

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

c-api/bytearray.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ <h3>瀏覽</h3>
400400
<a href="https://www.python.org/psf/donations/">Please donate.</a>
401401
<br>
402402
<br>
403-
最後更新於 5月 06, 2025 (05:50 UTC)。
403+
最後更新於 5月 10, 2025 (02:38 UTC)。
404404

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

c-api/bytes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ <h3>瀏覽</h3>
521521
<a href="https://www.python.org/psf/donations/">Please donate.</a>
522522
<br>
523523
<br>
524-
最後更新於 5月 06, 2025 (05:50 UTC)。
524+
最後更新於 5月 10, 2025 (02:38 UTC)。
525525

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

c-api/call.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ <h3>瀏覽</h3>
652652
<a href="https://www.python.org/psf/donations/">Please donate.</a>
653653
<br>
654654
<br>
655-
最後更新於 5月 06, 2025 (05:50 UTC)。
655+
最後更新於 5月 10, 2025 (02:38 UTC)。
656656

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

c-api/capsule.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ <h3>瀏覽</h3>
441441
<a href="https://www.python.org/psf/donations/">Please donate.</a>
442442
<br>
443443
<br>
444-
最後更新於 5月 06, 2025 (05:50 UTC)。
444+
最後更新於 5月 10, 2025 (02:38 UTC)。
445445

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

c-api/cell.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ <h3>瀏覽</h3>
341341
<a href="https://www.python.org/psf/donations/">Please donate.</a>
342342
<br>
343343
<br>
344-
最後更新於 5月 06, 2025 (05:50 UTC)。
344+
最後更新於 5月 10, 2025 (02:38 UTC)。
345345

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

0 commit comments

Comments
 (0)