Skip to content

Commit 24ee2af

Browse files
committed
A few more edits (CR)
1 parent 521c83b commit 24ee2af

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

Doc/library/inspect.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
635635
.. function:: ismethoddescriptor(object)
636636

637637
Return ``True`` if the object is a method descriptor, but not if
638-
:func:`isclass`, :func:`ismethod` or :func:`isfunction` are true.
638+
:func:`isclass`, :func:`ismethod` or :func:`isfunction` is true.
639639

640640
This, for example, is true of ``int.__add__``. An object passing this test
641641
has a :meth:`~object.__get__` method, but not a :meth:`~object.__set__`
@@ -645,8 +645,8 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
645645

646646
Method descriptors that also pass any of the other tests (:func:`!isclass`,
647647
:func:`!ismethod` or :func:`!isfunction`) make this function return ``False``,
648-
simply because those other tests promise more -- you can, e.g., count on
649-
having the :attr:`~method.__func__` attribute when an object passes
648+
simply because those other tests promise more -- you can, for example, count
649+
on having the :attr:`~method.__func__` attribute when an object passes
650650
:func:`ismethod`.
651651

652652
.. versionchanged:: 3.13
@@ -658,7 +658,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
658658
.. function:: isdatadescriptor(object)
659659

660660
Return ``True`` if the object is a data descriptor, but not if
661-
:func:`isclass`, :func:`ismethod` or :func:`isfunction` are true.
661+
:func:`isclass`, :func:`ismethod` or :func:`isfunction` is true.
662662

663663
Data descriptors always have a :meth:`~object.__set__` method and/or
664664
a :meth:`~object.__delete__` method. Optionally, they may also have a

Lib/inspect.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,18 +196,17 @@ def ispackage(object):
196196
def ismethoddescriptor(object):
197197
"""Return true if the object is a method descriptor.
198198
199-
But not if ismethod() or isclass() or isfunction() are true.
199+
But not if ismethod(), isclass() or isfunction() is true.
200200
201-
This is new in Python 2.2, and, for example, is true of int.__add__.
202-
An object passing this test has a __get__ attribute, but not a
203-
__set__ attribute or a __delete__ attribute. Beyond that, the set
204-
of attributes varies; __name__ is usually sensible, and __doc__
205-
often is.
201+
An object passing this test (for example, int.__add__) has a __get__
202+
attribute, but not a __set__ attribute or a __delete__ attribute.
203+
Beyond that, the set of attributes varies; __name__ is usually
204+
sensible, and __doc__ often is.
206205
207206
Methods implemented via descriptors that also pass one of the other
208207
tests (ismethod(), isclass(), isfunction()) make this function return
209-
false, simply because those other tests promise more -- you can, e.g.,
210-
count on having the __func__ attribute when an object passes
208+
false, simply because those other tests promise more -- you can, for
209+
example, count on having the __func__ attribute when an object passes
211210
ismethod()."""
212211
if isclass(object) or ismethod(object) or isfunction(object):
213212
# mutual exclusion
@@ -220,7 +219,7 @@ def ismethoddescriptor(object):
220219
def isdatadescriptor(object):
221220
"""Return true if the object is a data descriptor.
222221
223-
But not if ismethod() or isclass() or isfunction() are true.
222+
But not if ismethod(), isclass() or isfunction() is true.
224223
225224
Data descriptors have a __set__ or a __delete__ attribute. Examples are
226225
properties, getsets, and members. For the latter two (defined only in C

0 commit comments

Comments
 (0)