[Python-checkins] r85822 - python/branches/py3k/Modules/ossaudiodev.c

Georg Brandl g.brandl at gmx.net
Sun Oct 24 22:46:15 CEST 2010


Am 24.10.2010 21:14, schrieb "Martin v. Löwis":
>> Add casts (one needed, one for consistency).
> 
> FWIW, I feel that these casts are misguided. Having function pointer
> casts means that type errors in the signature get suppressed. E.g.
> people using such casts for tp_hash will be unable to detect the change
> in the tp_hash return type that we have implemented for 3.2.
> 
> It would be better, IMO, if these casts get avoided everywhere, even
> if that means that the functions get a line longer.

(For those not following python-checkins, this is about casting type member
functions to (PyCFunction) in PyMethodDefs.)

Sure, but it's not only the argument types that makes the casts necessary,
but also the argument count in the case of METH_KEYWORDS.

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-checkins mailing list