gh-94808: Cover `PyEval_GetFuncDesc` function
This function is very stange. I don't understand:
- Why it is needed
- Why it is
" object"and not"object"
Related https://github.com/python/cpython/issues/81826
CC @encukou Can we deprecate it?
- Issue: gh-94808
Looks like it's part of the stable ABI, so for the moment we can't get rid of it. It was used in 2.7: https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3f420bb23be1d081dac4/Python/ceval.c#L4499
so for the moment we can't get rid of it.
But, we can at least deprecate it :)
It's intended to be used with PyEval_GetFuncName, so it appends () in foo() but [space]object in SomeType object. As external API, it's definitely weird.
See https://github.com/python/cpython/issues/81826 for deprecating them both.
Thanks @sobolevn for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. 🐍🍒⛏🤖
Sorry, @sobolevn and @iritkatriel, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker b5f711185bd11819566068ddf2a74a1402340e2d 3.10
GH-99126 is a backport of this pull request to the 3.11 branch.