[Python-Dev] Why is nb_inplace_power ternary? (original) (raw)
Raymond Hettinger python at rcn.com
Fri Feb 9 06:30:05 CET 2007
- Previous message: [Python-Dev] Why is nb_inplace_power ternary?
- Next message: [Python-Dev] Why is nb_inplace_power ternary?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[MvL]
1. For 2.5.1, rewrite slotnbinplacepower to raise an exception if the third argument is not None, and then invoke ipow with only one argument.
[Raymond]
Why would you change Py2.5? There is no bug here.
[MvL]
There is: slotnbinplace has the signature
static PyObject * slotnbinplacepower(PyObject *self, PyObject * arg1) yet it is stored in asnumber.nbinplacepower, which is defined as typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *); ternaryfunc nbinplacepower; This has undefined behavior. Even if it had, slotnbinplacepower would silently discard its third argument.
That made sense, but my question was whether there would be benefit to making the change in the middle of a major release. At worst, code that is currently working due to undefined behavior will stop working. I don't see any offsetting benefit. ISTM that Py2.5 should be left as-is and that the full signature change be made in Py2.6.
Raymond
- Previous message: [Python-Dev] Why is nb_inplace_power ternary?
- Next message: [Python-Dev] Why is nb_inplace_power ternary?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]