Skip to content

Commit d227998

Browse files
Deploy preview for PR 1231 🛫
1 parent c7cf3ab commit d227998

586 files changed

Lines changed: 815 additions & 729 deletions

File tree

Some content is hidden

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

pr-preview/pr-1231/_sources/glossary.rst.txt

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,24 @@ Glossary
9696
:meth:`~object.__aexit__` methods. Introduced by :pep:`492`.
9797

9898
asynchronous generator
99-
A function which returns an :term:`asynchronous generator iterator`. It
100-
looks like a coroutine function defined with :keyword:`async def` except
101-
that it contains :keyword:`yield` expressions for producing a series of
102-
values usable in an :keyword:`async for` loop.
103-
104-
Usually refers to an asynchronous generator function, but may refer to an
105-
*asynchronous generator iterator* in some contexts. In cases where the
106-
intended meaning isn't clear, using the full terms avoids ambiguity.
99+
Informally used to mean either an :term:`asynchronous generator
100+
function` or an :term:`asynchronous generator iterator`, depending on
101+
context. The formal terms :term:`asynchronous generator function` and
102+
:term:`asynchronous generator iterator` are uncommon in practice;
103+
"asynchronous generator" alone is almost always sufficient.
104+
105+
asynchronous generator function
106+
A function which returns an :term:`asynchronous generator iterator`.
107+
It looks like a coroutine function defined with :keyword:`async def`
108+
except that it contains :keyword:`yield` expressions for producing a
109+
series of values usable in an :keyword:`async for` loop. See :pep:`525`.
107110

108111
An asynchronous generator function may contain :keyword:`await`
109112
expressions as well as :keyword:`async for`, and :keyword:`async with`
110113
statements.
111114

112115
asynchronous generator iterator
113-
An object created by an :term:`asynchronous generator` function.
116+
An object created by an :term:`asynchronous generator function`.
114117

115118
This is an :term:`asynchronous iterator` which when called using the
116119
:meth:`~object.__anext__` method returns an awaitable object which will execute
@@ -641,23 +644,33 @@ Glossary
641644
.. index:: single: generator
642645

643646
generator
644-
A function which returns a :term:`generator iterator`. It looks like a
645-
normal function except that it contains :keyword:`yield` expressions
646-
for producing a series of values usable in a for-loop or that can be
647-
retrieved one at a time with the :func:`next` function.
647+
Informally used to mean either a :term:`generator function` or a
648+
:term:`generator iterator`, depending on context. The formal terms
649+
:term:`generator function` and :term:`generator iterator` are uncommon
650+
in practice; "generator" alone is almost always sufficient.
648651

649-
Usually refers to a generator function, but may refer to a
650-
*generator iterator* in some contexts. In cases where the intended
651-
meaning isn't clear, using the full terms avoids ambiguity.
652+
.. index:: single: generator function
653+
654+
generator function
655+
A function which returns a :term:`generator` object. It looks like a
656+
normal function except that it contains :keyword:`yield` expressions
657+
for producing a series of values usable in a :keyword:`for`\-loop or
658+
that can be retrieved one at a time with the :func:`next` function.
659+
See :ref:`yieldexpr`.
652660

653661
generator iterator
654-
An object created by a :term:`generator` function.
662+
An object created by a :term:`generator function` or a
663+
:term:`generator expression`.
655664

656665
Each :keyword:`yield` temporarily suspends processing, remembering the
657-
execution state (including local variables and pending
658-
try-statements). When the *generator iterator* resumes, it picks up where
659-
it left off (in contrast to functions which start fresh on every
660-
invocation).
666+
execution state (including local variables and pending try-statements).
667+
When the *generator iterator* resumes, it picks up where it left off
668+
(in contrast to functions which start fresh on every invocation).
669+
670+
Generator iterators also implement the :meth:`~generator.send` method
671+
to send a value into the suspended generator, and the
672+
:meth:`~generator.throw` method to raise an exception at the point
673+
where the generator was paused. See :ref:`generator-methods`.
661674

662675
.. index:: single: generator expression
663676

pr-preview/pr-1231/_sources/library/dialog.rst.txt

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,31 @@ The :mod:`!tkinter.simpledialog` module contains convenience classes and
1515
functions for creating simple modal dialogs to get a value from the user.
1616

1717

18-
.. function:: askfloat(title, prompt, **kw)
19-
askinteger(title, prompt, **kw)
20-
askstring(title, prompt, **kw)
18+
.. function:: askfloat(title, prompt, *, initialvalue=None, minvalue=None, maxvalue=None, parent=None)
19+
askinteger(title, prompt, *, initialvalue=None, minvalue=None, maxvalue=None, parent=None)
20+
askstring(title, prompt, *, initialvalue=None, show=None, parent=None)
2121
22-
The above three functions provide dialogs that prompt the user to enter a value
23-
of the desired type.
22+
Prompt the user to enter a value of the desired type and return it, or
23+
``None`` if the dialog is cancelled.
24+
25+
*title* is the dialog title and *prompt* the message shown above the entry.
26+
*initialvalue* is the value initially placed in the entry.
27+
*parent* is the window over which the dialog is shown.
28+
:func:`askinteger` and :func:`askfloat` also accept *minvalue* and
29+
*maxvalue*, which bound the accepted value.
30+
:func:`askstring` also accepts *show*, a character used to mask the entered
31+
text, for example ``'*'`` to hide a password.
2432

2533
.. class:: Dialog(parent, title=None)
2634

2735
The base class for custom dialogs.
36+
Instantiating it shows the dialog modally and returns once the user closes
37+
it; the entered value is then available in the :attr:`!result` attribute.
38+
39+
.. attribute:: result
40+
41+
The value produced by :meth:`apply`, or ``None`` if the dialog was
42+
cancelled.
2843

2944
.. method:: body(master)
3045

@@ -46,7 +61,8 @@ functions for creating simple modal dialogs to get a value from the user.
4661

4762
.. method:: apply()
4863

49-
Process the data entered by the user.
64+
Process the data entered by the user, for example by storing it in the
65+
:attr:`!result` attribute.
5066
Called after :meth:`validate` succeeds and just before the dialog is
5167
destroyed.
5268
The default implementation does nothing; override it to act on or store

pr-preview/pr-1231/_static/glossary.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pr-preview/pr-1231/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ <h3>導航</h3>
356356
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
357357
<br>
358358
<br>
359-
最後更新於 6月 20, 2026 (18:12 UTC)。
359+
最後更新於 6月 22, 2026 (00:51 UTC)。
360360

361361
<a href="/bugs.html">發現 bug</a>
362362

pr-preview/pr-1231/bugs.html

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

@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 6月 20, 2026 (18:12 UTC)。
396+
最後更新於 6月 22, 2026 (00:51 UTC)。
397397

398398
<a href="/bugs.html">發現 bug</a>
399399

pr-preview/pr-1231/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>導航</h3>
365365
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
366366
<br>
367367
<br>
368-
最後更新於 6月 20, 2026 (18:12 UTC)。
368+
最後更新於 6月 22, 2026 (00:51 UTC)。
369369

370370
<a href="/bugs.html">發現 bug</a>
371371

pr-preview/pr-1231/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ <h3>導航</h3>
577577
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
578578
<br>
579579
<br>
580-
最後更新於 6月 20, 2026 (18:12 UTC)。
580+
最後更新於 6月 22, 2026 (00:51 UTC)。
581581

582582
<a href="/bugs.html">發現 bug</a>
583583

pr-preview/pr-1231/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>導航</h3>
514514
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
515515
<br>
516516
<br>
517-
最後更新於 6月 20, 2026 (18:12 UTC)。
517+
最後更新於 6月 22, 2026 (00:51 UTC)。
518518

519519
<a href="/bugs.html">發現 bug</a>
520520

pr-preview/pr-1231/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ <h3>導航</h3>
996996
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
997997
<br>
998998
<br>
999-
最後更新於 6月 20, 2026 (18:12 UTC)。
999+
最後更新於 6月 22, 2026 (00:51 UTC)。
10001000

10011001
<a href="/bugs.html">發現 bug</a>
10021002

pr-preview/pr-1231/c-api/bool.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/">敬請捐贈。</a>
377377
<br>
378378
<br>
379-
最後更新於 6月 20, 2026 (18:12 UTC)。
379+
最後更新於 6月 22, 2026 (00:51 UTC)。
380380

381381
<a href="/bugs.html">發現 bug</a>
382382

0 commit comments

Comments
 (0)