Skip to content

Commit 9b1a6c1

Browse files
Deploy preview for PR 1226 🛫
1 parent bfd3de9 commit 9b1a6c1

583 files changed

Lines changed: 676 additions & 598 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-1226/_sources/library/inspect.rst.txt

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,24 +407,63 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
407407

408408
Return ``True`` if the object is a bound method written in Python.
409409

410+
.. note::
410411

411-
.. function:: ispackage(object)
412+
For example, given this class::
412413

413-
Return ``True`` if the object is a :term:`package`.
414+
>>> class Greeter:
415+
... def say_hello(self):
416+
... print('hello!')
414417

415-
.. versionadded:: 3.14
418+
A bound method (also known as an *instance method*) is created when
419+
accessing ``say_hello`` (a :term:`function` defined in the
420+
``Greeter`` namespace) through an instance of the ``Greeter`` class::
421+
422+
>>> instance = Greeter()
423+
424+
>>> instance.say_hello
425+
<bound method Greeter.say_hello of <__main__.Greeter object ...>>
426+
>>> ismethod(instance.say_hello)
427+
True
428+
>>> isfunction(instance.say_hello)
429+
False
430+
431+
Accessing ``say_hello`` through the ``Greeter`` class will return the
432+
function itself. For this function, :func:`ismethod` will return
433+
``False``, but :func:`isfunction` will return ``True``::
434+
435+
>>> Greeter.say_hello
436+
<function Greeter.say_hello at 0x7f7503854a90>
437+
>>> ismethod(Greeter.say_hello)
438+
False
439+
>>> isfunction(Greeter.say_hello)
440+
True
441+
442+
See :ref:`typesmethods` for details.
416443

417444

418445
.. function:: isfunction(object)
419446

420447
Return ``True`` if the object is a Python function, which includes functions
421448
created by a :term:`lambda` expression.
422449

450+
See the note for :func:`~inspect.ismethod` for an example.
451+
452+
453+
.. function:: ispackage(object)
454+
455+
Return ``True`` if the object is a :term:`package`.
456+
457+
.. versionadded:: 3.14
458+
423459

424460
.. function:: isgeneratorfunction(object)
425461

426462
Return ``True`` if the object is a Python generator function.
427463

464+
It also returns ``True`` for bound methods created from Python generator functions
465+
(see :ref:`typesmethods` for more information).
466+
428467
.. versionchanged:: 3.8
429468
Functions wrapped in :func:`functools.partial` now return ``True`` if the
430469
wrapped function is a Python generator function.

pr-preview/pr-1226/_sources/library/ssl.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@ to speed up repeated connections from the same clients.
19501950
:attr:`~SSLContext.minimum_version` and
19511951
:attr:`SSLContext.options` all affect the supported SSL
19521952
and TLS versions of the context. The implementation does not prevent
1953-
invalid combination. For example a context with
1953+
invalid combinations. For example a context with
19541954
:attr:`OP_NO_TLSv1_2` in :attr:`~SSLContext.options` and
19551955
:attr:`~SSLContext.maximum_version` set to :attr:`TLSVersion.TLSv1_2`
19561956
will not be able to establish a TLS 1.2 connection.
@@ -2753,11 +2753,11 @@ disabled by default.
27532753
::
27542754

27552755
>>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
2756-
>>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3
2756+
>>> client_context.minimum_version = ssl.TLSVersion.TLSv1_2
27572757
>>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3
27582758

27592759

2760-
The SSL context created above will only allow TLSv1.3 and later (if
2760+
The SSL client context created above will only allow TLSv1.2 and TLSv1.3 (if
27612761
supported by your system) connections to a server. :const:`PROTOCOL_TLS_CLIENT`
27622762
implies certificate validation and hostname checks by default. You have to
27632763
load certificates into the context.

pr-preview/pr-1226/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-
最後更新於 5月 18, 2026 (06:50 UTC)。
359+
最後更新於 5月 19, 2026 (00:45 UTC)。
360360

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

pr-preview/pr-1226/bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 5月 18, 2026 (06:50 UTC)。
396+
最後更新於 5月 19, 2026 (00:45 UTC)。
397397

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

pr-preview/pr-1226/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-
最後更新於 5月 18, 2026 (06:50 UTC)。
368+
最後更新於 5月 19, 2026 (00:45 UTC)。
369369

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

pr-preview/pr-1226/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-
最後更新於 5月 18, 2026 (06:50 UTC)。
580+
最後更新於 5月 19, 2026 (00:45 UTC)。
581581

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

pr-preview/pr-1226/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-
最後更新於 5月 18, 2026 (06:50 UTC)。
517+
最後更新於 5月 19, 2026 (00:45 UTC)。
518518

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

pr-preview/pr-1226/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-
最後更新於 5月 18, 2026 (06:50 UTC)。
999+
最後更新於 5月 19, 2026 (00:45 UTC)。
10001000

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

pr-preview/pr-1226/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-
最後更新於 5月 18, 2026 (06:50 UTC)。
379+
最後更新於 5月 19, 2026 (00:45 UTC)。
380380

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

pr-preview/pr-1226/c-api/buffer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ <h3>導航</h3>
10641064
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
10651065
<br>
10661066
<br>
1067-
最後更新於 5月 18, 2026 (06:50 UTC)。
1067+
最後更新於 5月 19, 2026 (00:45 UTC)。
10681068

10691069
<a href="/bugs.html">發現 bug</a>
10701070

0 commit comments

Comments
 (0)