cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-94808: Cover `PyEval_GetFuncDesc` function

Open sobolevn opened this issue 3 years ago • 2 comments

Снимок экрана 2022-10-15 в 23 54 22

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

sobolevn avatar Oct 15 '22 20:10 sobolevn

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

JelleZijlstra avatar Oct 16 '22 04:10 JelleZijlstra

so for the moment we can't get rid of it.

But, we can at least deprecate it :)

sobolevn avatar Oct 16 '22 06:10 sobolevn

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.

encukou avatar Oct 17 '22 11:10 encukou

Thanks @sobolevn for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. 🐍🍒⛏🤖

miss-islington avatar Nov 05 '22 13:11 miss-islington

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

miss-islington avatar Nov 05 '22 13:11 miss-islington

GH-99126 is a backport of this pull request to the 3.11 branch.

bedevere-bot avatar Nov 05 '22 13:11 bedevere-bot