WHUI! (was Re: [Python-Dev] Proposal: C API Macro to decref andset to NULL) (original) (raw)
Jim Fulton jim at zope.com
Tue Jul 13 17:36:26 CEST 2004
- Previous message: WHUI! (was Re: [Python-Dev] Proposal: C API Macro to decref andset to NULL)
- Next message: WHUI! (was Re: [Python-Dev] Proposal: C API Macro to decref andset to NULL)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Jeremy Hylton wrote:
I still don't like it, because it hides the return.
It should be used in the core, but you don't have to use it in your own code.
I'd rather do: if (self->foo != NULL && (vret = visit(self->foo, arg))) return vret; This violates the Python C style by putting an assignment in a conditional.
Where is this documented? Assignments in conditionals are used widely in the C sources, including such places as gcmodule.c, object.c, and typeobject.c.
Jim
-- Jim Fulton mailto:jim at zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
- Previous message: WHUI! (was Re: [Python-Dev] Proposal: C API Macro to decref andset to NULL)
- Next message: WHUI! (was Re: [Python-Dev] Proposal: C API Macro to decref andset to NULL)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]