[New-bugs-announce] [issue34280] METH_NOARGS: no longer require that second arg is NULL

Jeroen Demeyer report at bugs.python.org
Mon Jul 30 07:56:35 EDT 2018


New submission from Jeroen Demeyer <J.Demeyer at UGent.be>:

A C function with signature METH_NOARGS takes two arguments where the first is "self" and the second is guaranteed to be NULL. Given that this second argument really should never be used, I would like to drop the guarantee that the argument is NULL.

Concretely, I propose to change:

1. the documentation for METH_NOARGS

2. some functions in Modules/_io/bufferedio.c which actually do use the second argument of a METH_NOARGS function.

For the moment, the second argument is still NULL, but one is not supposed to rely on that.

The reason for this patch is that this second argument can be re-purposed in PEP 580 (and possibly PEP 573) to pass the function object.

----------
components: Interpreter Core
messages: 322670
nosy: jdemeyer
priority: normal
severity: normal
status: open
title: METH_NOARGS: no longer require that second arg is NULL
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34280>
_______________________________________


More information about the New-bugs-announce mailing list