[Python-bugs-list] [ python-Bugs-548651 ] Fix the METH_CLASS implementation

noreply@sourceforge.net noreply@sourceforge.net
Tue, 26 Nov 2002 02:30:23 -0800


Bugs item #548651, was opened at 2002-04-25 17:15
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=548651&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
>Priority: 8
Submitted By: Thomas Heller (theller)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Fix the METH_CLASS implementation

Initial Comment:
The devel-docs about METH_CLASS:

The method will be passed the type object as the first 
parameter rather than an instance of the type. This is 
used to create class methods, similar to what is 
created when using the classmethod() built-in 
function. New in version 2.3.

The code does not do it in this way. The first 
parameter the function receives is NULL, the type 
object goes together with the remaining arguments
in the second parameter (which is a tuple).

See the thread with subject 'METH_CLASS' on python-dev 
at 2002-04-25, Guido agreed that this should be fixed.


----------------------------------------------------------------------

>Comment By: Just van Rossum (jvr)
Date: 2002-11-26 11:30

Message:
Logged In: YES 
user_id=92689

This has been open since april, and becomes immediately
relevant with rhettingers dict.fromseq() classmethod
addition: patch #643443. I hadn't seen this bug report
before, but looking at Raymond's code I wondered why cls was
passed as part of args instead of as the first arg of the C
function. I ended up here... I think it's *crucial* this is
fixed before the first alpha of 2.3 is released. Upping the
priority by one...

----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2002-05-24 11:53

Message:
Logged In: YES 
user_id=11105

IMO this should be fixed before 2.3 is released, so I'm
raising the priority to 7.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=548651&group_id=5470