Issue513713

classification
Title: PyTableCode != PyCode
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, fwierzbicki, leouserz, pmhahn
Priority: low Keywords:

Created on 2002-02-06.12:32:15 by pmhahn, last changed 2008-11-01.14:02:48 by fwierzbicki.

Messages
msg566 (view) Author: Philipp Hahn (pmhahn) Date: 2002-02-06.12:32:15
Running python2.1 and jython2.1 give's different
results using the inspect.iscode() method.

Python 2.1.2 (#1, Jan 18 2002, 18:05:45) 
[GCC 2.95.4  (Debian prerelease)] on linux2
>>> import types,inspect
>>> types.CodeType
<type 'code'>
>>> type(inspect.currentframe().f_code)
<type 'code'>
>>> type(inspect.currentframe().f_code) is types.CodeType
1

Jython 2.1 on java1.3.1 (JIT: null)
>>> import types,inspect
>>> types.CodeType
<jclass org.python.core.PyCode at 1330621>
>>> type(inspect.currentframe().f_code)
<jclass org.python.core.PyTableCode at 503405>
>>> type(inspect.currentframe().f_code) is types.CodeType
0
msg567 (view) Author: Deleted User leouserz (leouserz) Date: 2006-12-21.15:22:29
this is an odd bug to report given that it appears inspect doesn't ship with jython 2.1 and with the current inspect module there isn't a "currentframe" method.  Beyond that, Im not sure if the report is invalid at this time.

leouser
msg568 (view) Author: Charlie Groves (cgroves) Date: 2007-05-19.17:24:54
Inspect ships with jython-2.2b2 and this is still valid unfortunately.
msg3727 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-11-01.02:46:18
We now get a correct "is" at the end of this test though the types are
<type 'tablecode'>

Jython 2.5b0 (trunk:5536:5537, Oct 31 2008, 12:34:26) 
[Java HotSpot(TM) Client VM (Apple Inc.)] on java1.5.0_16
Type "help", "copyright", "credits" or "license" for more information.
>>> import types,inspect
>>> types.CodeType
<type 'tablecode'>
>>> type(inspect.currentframe().f_code)
<type 'tablecode'>
>>> type(inspect.currentframe().f_code) is types.CodeType
True
msg3730 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-11-01.14:02:48
Since the code:

type(inspect.currentframe().f_code) is types.CodeType

is now consistently True for both CPython and Jython, I think I can
close this.  Closing.
History
Date User Action Args
2008-11-01 14:02:48fwierzbickisetstatus: open -> closed
resolution: fixed
messages: + msg3730
2008-11-01 02:46:19fwierzbickisetnosy: + fwierzbicki
messages: + msg3727
2002-02-06 12:32:15pmhahncreate