Issue1777567

classification
Title: Type of reflected methods is different for Java and Python
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, janne_h
Priority: normal Keywords:

Created on 2007-08-20.10:40:33 by janne_h, last changed 2008-11-03.21:13:05 by fwierzbicki.

Messages
msg1850 (view) Author: Janne Härkönen (janne_h) Date: 2007-08-20.10:40:33
When a method is reflected from a class without making 
an instance of that class, the type of the method is 'method' for methods from Python classes and 'reflectedfunction' for methods from Java classes.


Jython 2.2rc3 on java1.6.0_01
Type "copyright", "credits" or "license" for more information.
>>> from java.lang import String
>>> type(String.indexOf), type(String().indexOf)
(<type 'reflectedfunction'>, <type 'method'>)
>>> from urllib import URLopener
>>> type(URLopener.open_http),type(URLopener().open_http)
(<type 'method'>, <type 'method'>)

And in Python:
Python 2.5.1 (r251:54863, May 18 2007, 16:56:43) 
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib import URLopener
>>> type(URLopener.open_http), type(URLopener().open_http)
(<type 'instancemethod'>, <type 'instancemethod'>)
>>> 
msg3742 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-11-03.21:13:04
trunk now calls "URLopener.open_http" instancemethod just like CPython.
 I think Java methods being called "reflectedfunction" is either a
feature or at least a non-issue since you can't get Java methods in
CPython, or (my opinion)
History
Date User Action Args
2008-11-03 21:13:05fwierzbickisetstatus: open -> closed
resolution: fixed
messages: + msg3742
nosy: + fwierzbicki
title: Type of reflected methods is different for Java and Python -> Type of reflected methods is different for Java and Python
2007-08-20 10:40:33janne_hcreate