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.

classification
Title: classmethod abuse --> SystemError
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: brett.cannon, mwh, rhettinger
Priority: normal Keywords:

Created on 2003-06-12 18:09 by mwh, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Messages (3)
msg16347 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2003-06-12 18:09
This is obviously a silly thing to do:

>>> classmethod(1).__get__(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
SystemError: ../Objects/classobject.c:2102: bad
argument to internal function

but I think that's still a bug.
msg16348 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-15 08:00
Logged In: YES 
user_id=357491

Well, couldn't we check if the argument is a non-data descriptor 
at least?  Since classmethod only works with new-style we know 
the method will be a non-data descriptor.  That should prevent 
allowing arguments like 1 being allowed through.
msg16349 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-06-18 01:13
Logged In: YES 
user_id=80475

Added a callability check.
See Objects/funcobject.c 1.195
History
Date User Action Args
2022-04-10 16:09:09adminsetgithub: 38631
2003-06-12 18:09:50mwhcreate