[New-bugs-announce] [issue20410] Argument Clinic: add 'self' return converter

Zachary Ware report at bugs.python.org
Mon Jan 27 19:30:18 CET 2014


New submission from Zachary Ware:

It would be nice to have a 'self' return converter for simple functions like winreg.HKEYType.__enter__ (which is implemented as "Py_XINCREF(self); return self;").  With the typedef and type_object specifications now required for the class directive, 'self' is passed to that function as a PyHKEYObject *, but impl is expected to return a PyObject *.

In this particular instance, I can solve the problem (which is a compiler warning) with a custom self_return_converter that casts _return_value to PyObject *.  I think a generic solution would be better in the long run and useful in more places, though.

----------
messages: 209457
nosy: larry, zach.ware
priority: low
severity: normal
stage: needs patch
status: open
title: Argument Clinic: add 'self' return converter
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20410>
_______________________________________


More information about the New-bugs-announce mailing list