Skip to content

Commit a657be8

Browse files
committed
Deploying to gh-pages from @ 5183882 🚀
1 parent 02e37e5 commit a657be8

File tree

526 files changed

+819
-589
lines changed

Some content is hidden

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

526 files changed

+819
-589
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: 935fb76aea4644b48b57d029f65de9eb
3+
config: 1184bc8ea9d2504cfa107dd50035f740
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/library/ast.rst.txt

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Node classes
4545

4646
This is the base of all AST node classes. The actual node classes are
4747
derived from the :file:`Parser/Python.asdl` file, which is reproduced
48-
:ref:`above <abstract-grammar>`. They are defined in the :mod:`_ast` C
48+
:ref:`above <abstract-grammar>`. They are defined in the :mod:`!_ast` C
4949
module and re-exported in :mod:`ast`.
5050

5151
There is one class defined for each left-hand side symbol in the abstract
@@ -128,14 +128,14 @@ Node classes
128128

129129
.. deprecated:: 3.8
130130

131-
Old classes :class:`ast.Num`, :class:`ast.Str`, :class:`ast.Bytes`,
132-
:class:`ast.NameConstant` and :class:`ast.Ellipsis` are still available,
131+
Old classes :class:`!ast.Num`, :class:`!ast.Str`, :class:`!ast.Bytes`,
132+
:class:`!ast.NameConstant` and :class:`!ast.Ellipsis` are still available,
133133
but they will be removed in future Python releases. In the meantime,
134134
instantiating them will return an instance of a different class.
135135

136136
.. deprecated:: 3.9
137137

138-
Old classes :class:`ast.Index` and :class:`ast.ExtSlice` are still
138+
Old classes :class:`!ast.Index` and :class:`!ast.ExtSlice` are still
139139
available, but they will be removed in future Python releases.
140140
In the meantime, instantiating them will return an instance of
141141
a different class.
@@ -1935,8 +1935,7 @@ Function and class definitions
19351935
.. class:: arg(arg, annotation, type_comment)
19361936

19371937
A single argument in a list. ``arg`` is a raw string of the argument
1938-
name, ``annotation`` is its annotation, such as a :class:`Str` or
1939-
:class:`Name` node.
1938+
name; ``annotation`` is its annotation, such as a :class:`Name` node.
19401939

19411940
.. attribute:: type_comment
19421941

@@ -2280,8 +2279,8 @@ and classes for traversing abstract syntax trees:
22802279
.. function:: get_source_segment(source, node, *, padded=False)
22812280

22822281
Get source code segment of the *source* that generated *node*.
2283-
If some location information (:attr:`lineno`, :attr:`end_lineno`,
2284-
:attr:`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``.
2282+
If some location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`,
2283+
:attr:`~ast.AST.col_offset`, or :attr:`~ast.AST.end_col_offset`) is missing, return ``None``.
22852284

22862285
If *padded* is ``True``, the first line of a multi-line statement will
22872286
be padded with spaces to match its original position.
@@ -2292,7 +2291,7 @@ and classes for traversing abstract syntax trees:
22922291
.. function:: fix_missing_locations(node)
22932292

22942293
When you compile a node tree with :func:`compile`, the compiler expects
2295-
:attr:`lineno` and :attr:`col_offset` attributes for every node that supports
2294+
:attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every node that supports
22962295
them. This is rather tedious to fill in for generated nodes, so this helper
22972296
adds these attributes recursively where not already set, by setting them to
22982297
the values of the parent node. It works recursively starting at *node*.
@@ -2307,8 +2306,8 @@ and classes for traversing abstract syntax trees:
23072306

23082307
.. function:: copy_location(new_node, old_node)
23092308

2310-
Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:`end_lineno`,
2311-
and :attr:`end_col_offset`) from *old_node* to *new_node* if possible,
2309+
Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :attr:`~ast.AST.end_lineno`,
2310+
and :attr:`~ast.AST.end_col_offset`) from *old_node* to *new_node* if possible,
23122311
and return *new_node*.
23132312

23142313

@@ -2354,14 +2353,18 @@ and classes for traversing abstract syntax trees:
23542353
visited unless the visitor calls :meth:`generic_visit` or visits them
23552354
itself.
23562355

2356+
.. method:: visit_Constant(node)
2357+
2358+
Handles all constant nodes.
2359+
23572360
Don't use the :class:`NodeVisitor` if you want to apply changes to nodes
23582361
during traversal. For this a special visitor exists
23592362
(:class:`NodeTransformer`) that allows modifications.
23602363

23612364
.. deprecated:: 3.8
23622365

2363-
Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`,
2364-
:meth:`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated
2366+
Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`,
2367+
:meth:`!visit_NameConstant` and :meth:`!visit_Ellipsis` are deprecated
23652368
now and will not be called in future Python versions. Add the
23662369
:meth:`visit_Constant` method to handle all constant nodes.
23672370

@@ -2390,7 +2393,7 @@ and classes for traversing abstract syntax trees:
23902393
)
23912394

23922395
Keep in mind that if the node you're operating on has child nodes you must
2393-
either transform the child nodes yourself or call the :meth:`generic_visit`
2396+
either transform the child nodes yourself or call the :meth:`~ast.NodeVisitor.generic_visit`
23942397
method for the node first.
23952398

23962399
For nodes that were part of a collection of statements (that applies to all
@@ -2399,7 +2402,7 @@ and classes for traversing abstract syntax trees:
23992402

24002403
If :class:`NodeTransformer` introduces new nodes (that weren't part of
24012404
original tree) without giving them location information (such as
2402-
:attr:`lineno`), :func:`fix_missing_locations` should be called with
2405+
:attr:`~ast.AST.lineno`), :func:`fix_missing_locations` should be called with
24032406
the new sub-tree to recalculate the location information::
24042407

24052408
tree = ast.parse('foo', mode='eval')

about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ <h3>瀏覽</h3>
308308
<br />
309309
<br />
310310

311-
最後更新於 Dec 19, 2023 (13:45 UTC)。
311+
最後更新於 Dec 20, 2023 (01:35 UTC)。
312312
<a href="/bugs.html">Found a bug</a>?
313313
<br />
314314

bugs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
224224
</section>
225225
<section id="getting-started-contributing-to-python-yourself">
226226
<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>
227-
<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>
227+
<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>
228228
</section>
229229
</section>
230230

@@ -344,7 +344,7 @@ <h3>瀏覽</h3>
344344
<br />
345345
<br />
346346

347-
最後更新於 Dec 19, 2023 (13:45 UTC)。
347+
最後更新於 Dec 20, 2023 (01:35 UTC)。
348348
<a href="/bugs.html">Found a bug</a>?
349349
<br />
350350

c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ <h3>瀏覽</h3>
318318
<br />
319319
<br />
320320

321-
最後更新於 Dec 19, 2023 (13:45 UTC)。
321+
最後更新於 Dec 20, 2023 (01:35 UTC)。
322322
<a href="/bugs.html">Found a bug</a>?
323323
<br />
324324

c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ <h3>瀏覽</h3>
332332
<br />
333333
<br />
334334

335-
最後更新於 Dec 19, 2023 (13:45 UTC)。
335+
最後更新於 Dec 20, 2023 (01:35 UTC)。
336336
<a href="/bugs.html">Found a bug</a>?
337337
<br />
338338

c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ <h3>瀏覽</h3>
364364
<br />
365365
<br />
366366

367-
最後更新於 Dec 19, 2023 (13:45 UTC)。
367+
最後更新於 Dec 20, 2023 (01:35 UTC)。
368368
<a href="/bugs.html">Found a bug</a>?
369369
<br />
370370

c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ <h3>瀏覽</h3>
875875
<br />
876876
<br />
877877

878-
最後更新於 Dec 19, 2023 (13:45 UTC)。
878+
最後更新於 Dec 20, 2023 (01:35 UTC)。
879879
<a href="/bugs.html">Found a bug</a>?
880880
<br />
881881

c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ <h3>瀏覽</h3>
329329
<br />
330330
<br />
331331

332-
最後更新於 Dec 19, 2023 (13:45 UTC)。
332+
最後更新於 Dec 20, 2023 (01:35 UTC)。
333333
<a href="/bugs.html">Found a bug</a>?
334334
<br />
335335

c-api/buffer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ <h3>瀏覽</h3>
10021002
<br />
10031003
<br />
10041004

1005-
最後更新於 Dec 19, 2023 (13:45 UTC)。
1005+
最後更新於 Dec 20, 2023 (01:35 UTC)。
10061006
<a href="/bugs.html">Found a bug</a>?
10071007
<br />
10081008

0 commit comments

Comments
 (0)