This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Deprecate inspect.Signature.from_function and from_builtin
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: yselivanov Nosy List: brett.cannon, larry, ncoghlan, python-dev, yselivanov
Priority: normal Keywords: patch

Created on 2015-05-20 18:33 by yselivanov, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
sig_warns.patch yselivanov, 2015-05-20 21:03 review
Messages (9)
msg243684 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-05-20 18:33
I want to deprecate Signature.from_function and Signature.from_builtin in 3.5.

There is no use for these methods (they aren't generic), and we also now have a very handy 'from_callable' for easy Signature subclassing.
msg243685 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-05-20 18:40
Forgot to mention: from_function and from_builtin are not documented.
msg243695 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-05-20 21:03
Patch is attached.
msg243711 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2015-05-21 01:31
+1 from me.

The deprecation warning text in the patch has a typo (callback instead of callable).

For the documentation, in addition to noting the deprecation itself, it may also be worth noting how to explicitly recreate the type restriction.
msg243712 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-05-21 01:33
> For the documentation, in addition to noting the deprecation itself, it may also be worth noting how to explicitly recreate the type restriction.

Nick, what do you mean by "type restriction"?  Also, since the functions aren't documented, I think we don't need to document that they are deprecated?
msg243717 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2015-05-21 03:07
Oh, right - you said they weren't documented, and I completely glazed over that bit.

The "type restrictions" comment isn't valid in the absence of documentation, but it was basically about how to fully replicate the behaviour of the existing functions in conjunction with "from_callable".
msg243718 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-21 03:08
New changeset 64fba4ea031b by Yury Selivanov in branch 'default':
Issue 24248: Deprecate inspect.Signature.from_function and .from_builtin
https://hg.python.org/cpython/rev/64fba4ea031b
msg243719 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-05-21 03:09
OK, committed! Thanks for the review, Nick.
msg243721 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-05-21 03:11
I documented the deprecation in the whatsnew section anyways.
History
Date User Action Args
2022-04-11 14:58:17adminsetgithub: 68436
2015-05-21 03:11:08yselivanovsetmessages: + msg243721
2015-05-21 03:09:25yselivanovsetstatus: open -> closed
resolution: fixed
stage: resolved
2015-05-21 03:09:09yselivanovsetmessages: + msg243719
2015-05-21 03:08:14python-devsetnosy: + python-dev
messages: + msg243718
2015-05-21 03:07:27ncoghlansetmessages: + msg243717
2015-05-21 01:33:33yselivanovsetmessages: + msg243712
2015-05-21 01:31:20ncoghlansetmessages: + msg243711
2015-05-20 21:03:02yselivanovsetfiles: + sig_warns.patch
keywords: + patch
messages: + msg243695
2015-05-20 18:40:18yselivanovsetmessages: + msg243685
2015-05-20 18:33:34yselivanovcreate