Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Doc: add versionchanged...
  • Loading branch information
zuo committed Jun 15, 2024
commit 01178fab7a0f50537e8aa83eef830f03ad8dd467
6 changes: 6 additions & 0 deletions Doc/library/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,12 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
:attr:`~method.__func__` attribute (etc) when an object passes
:func:`ismethod`.

.. versionchanged:: 3.13
For objects with :meth:`~object.__get__` and :meth:`~object.__delete__`
but without :meth:`~object.__set__`, ``False`` is now returned
(previously, ``True`` was returned for such objects, which was
incorrect).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For objects with :meth:`~object.__get__` and :meth:`~object.__delete__`
but without :meth:`~object.__set__`, ``False`` is now returned
(previously, ``True`` was returned for such objects, which was
incorrect).
Objects with :meth:`~object.__get__` and :meth:`~object.__delete__`
but without :meth:`~object.__set__` are no more considered as method
descriptors. In previous versions, they were incorrectly deemed as such.

@zuo zuo Jun 15, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@picnixz OK, I committed your suggestion. However, doesn't the fragment are no more considered as method descriptors sound too general? I mean, someone could misunderstand it – that before Python 3.13 such objects were generally considered as method descriptors; whereas our intent is to inform that just this particular function incorrectly considered them as such.

What do you think about such wording:

Objects with __get__() and __delete__() but without __set__() are no more considered by this function as method descriptors. In previous versions, they incorrectly were.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Or some other wording that would emphasize the focus on the behavior of this particular function...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just committed as slightly different variant:

      Objects with :meth:`~object.__get__` and :meth:`~object.__delete__`
      but without :meth:`~object.__set__` are no more considered by this
      function as method descriptors (in previous versions, they were
      incorrectly deemed as such).

Could you please decide whether it is OK. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a suggestion to tighten this up and make it clear it is describing a bug fix in this function rather than a change to the language itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :) I applied it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thanks! my suggestions are in the end only... suggestions. I appreciate when someone likes it verbatim but I don't mind when it is reformulated!



.. function:: isdatadescriptor(object)

Expand Down