Message4016
Jython 2.2 on java1.6.0_03
Type "copyright", "credits" or "license" for more information.
>>> import inspect
>>> from java.lang import String
>>> inspect.isroutine(String.toUpperCase)
0
>>> inspect.isroutine(str.upper)
1
>>> inspect.isroutine(String().toUpperCase)
1
>>> inspect.isroutine(str().upper)
1
>>> type(String.toUpperCase)
<type 'reflectedfunction'>
>>> type(str.upper)
<type 'methoddescr'>
>>> type(String().toUpperCase)
<type 'method'>
>>> type(str().upper)
<type 'builtin_function_or_method'>
It seems that PyReflectedFunction is not exposed correctly as a method.
We used this kind of a workaround:
def _isroutine(self, item):
return inspect.isroutine(item) \
or (utils.is_jython and isinstance(item, PyReflectedFunction)) |
|
Date |
User |
Action |
Args |
2009-01-08 14:54:15 | pekka.klarck | set | recipients:
+ pekka.klarck |
2009-01-08 14:54:15 | pekka.klarck | set | messageid: <1231426455.76.0.210510924581.issue1223@psf.upfronthosting.co.za> |
2009-01-08 14:54:15 | pekka.klarck | link | issue1223 messages |
2009-01-08 14:54:15 | pekka.klarck | create | |
|