This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author larry
Recipients barry, brett.cannon, gvanrossum, larry, meador.inge, ncoghlan, skrah, tim.peters, yselivanov, zach.ware
Date 2014-01-24.03:56:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390535778.41.0.852746525675.issue20189@psf.upfronthosting.co.za>
In-reply-to
Content
A little more on consistency and inconsistency.

I count 109 tp_new callback functions in CPython, and they overwhelmingly call the first parameter "PyTypeObject *type" (93 instances).  In second place is "PyObject *self" (9 instances), which is flat-out wrong.

I count 21 METH_CLASS callback functions in CPython; they prefer calling the first parameter "PyObject *cls" (16 instances).  In second place is "PyTypeObject *type" (3 instances).

Both callbacks are class methods.  And both callbacks are passed the *exact same object* for their first parameter, the PyTypeObject * representing that type.

I can see no good reason why they should have different names in different callbacks.  There's no practical or semantic difference between the two.  I suspect it's something silly like legacy code / copying and pasting / force of habit, perhaps carried over from the days before type/class unification.
History
Date User Action Args
2014-01-24 03:56:18larrysetrecipients: + larry, gvanrossum, tim.peters, barry, brett.cannon, ncoghlan, skrah, meador.inge, zach.ware, yselivanov
2014-01-24 03:56:18larrysetmessageid: <1390535778.41.0.852746525675.issue20189@psf.upfronthosting.co.za>
2014-01-24 03:56:18larrylinkissue20189 messages
2014-01-24 03:56:17larrycreate