rust-cpython icon indicating copy to clipboard operation
rust-cpython copied to clipboard

Don't use C type PyNoArgsFunction

Open serhiy-storchaka opened this issue 5 years ago • 2 comments

It is not used in Python core, should not be used in user code, and will be removed in Python 3.9. METH_NOARGS functions should have type PyCFunction instead of PyNoArgsFunction and take NULL as the second argument.

serhiy-storchaka avatar Jan 18 '20 09:01 serhiy-storchaka

@serhiy-storchaka Thanks for the heads-up, I see you've been the reviewer for that.

Some more resources:

  • https://bugs.python.org/issue18091
  • https://bugs.python.org/issue39372
  • https://github.com/python/cpython/pull/18037

gracinet avatar Jan 18 '20 18:01 gracinet

As far as I can see, it's not really used by rust-cpython, it's simply declared, like all other symbols, in python-*-sys.

Even if it's wrong from our users to use it in current Python versions, the simplest course of action seems hence to not declare it for Python >= 3.9

gracinet avatar Jan 18 '20 18:01 gracinet