Issue1638882

classification
Title: subclasses of BuiltinFunction types not BuiltinMethodType
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, leouserz
Priority: normal Keywords:

Created on 2007-01-18.19:06:58 by leouserz, last changed 2007-04-19.20:42:30 by cgroves.

Files
File name Uploaded Description Edit Remove
testbuiltins.py leouserz, 2007-01-18.19:06:58
Messages
msg1389 (view) Author: Deleted User leouserz (leouserz) Date: 2007-01-18.19:06:58
I ran into this will inspecting test_inspect and saw one of the errors thrown was this problem:

import types

bim = types.BuiltinMethodType
print bim
bim2 = types.BuiltinFunctionType
print bim2
print bim == bim2

print type(list.append)

a = type([].append)
print a

print a == bim
assert a== bim, "not a BuiltinMethodType"

running in python gives us this output:
python testbuiltins.py
<type 'builtin_function_or_method'>
<type 'builtin_function_or_method'>
1
<type 'method_descriptor'>
<type 'builtin_function_or_method'>
1

while in jython we get:
jython testbuiltins.py
<type 'method'>
<type 'reflectedfunction'>
0
<type 'methoddescr'>
<type 'list$1exposed_append'>
0
Traceback (innermost last):
  File "testbuiltins.py", line 15, in ?
AssertionError: not a BuiltinMethodType


leouser
msg1390 (view) Author: Deleted User leouserz (leouserz) Date: 2007-01-18.20:32:07
wow, this bug gets weirder.
types.BuiltinFunctionType
types.BuiltinMethodType
are ==
type(var) == type([].append)
is true

so this seems to become a bug in types and in PyBuiltinFunction.  types needs to have the Builtin*Types be derived from the same class and PyBuiltinFunction needs to have that type.
msg1391 (view) Author: Deleted User leouserz (leouserz) Date: 2007-01-18.21:21:46
patches and further discusion for this is here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1638982&group_id=12867&atid=312867

leouser
msg1392 (view) Author: Charlie Groves (cgroves) Date: 2007-04-19.20:42:30
This was fixed by my unification of all the builtin function types.
History
Date User Action Args
2007-01-18 19:06:58leouserzcreate