Message11955

Author psykiatris
Recipients Arfrever, jeff.allen, psykiatris, zyasoft
Date 2018-05-07.17:05:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525712753.78.0.682650639539.issue2305@psf.upfronthosting.co.za>
In-reply-to
Content
I took some time on this one. Through my debug sessions, in jython.java, the vaiables ps1 and ps2 are assigned the JavaType 'attributedeleted', So far, so good. 

As the following  shows, both of these variables end up as type('str)...
===========
Jython 2.7.1 (, Sep 30 2017, 13:31:09) 
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.8.0_162
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> a = sys.ps1
>>> b = sys.ps2
>>> print a, b
>>>  ... 
>>> print type(a), type(b)
<type 'str'> <type 'str'>
>>> # Can you change the prompt?
>>> sys.ps1 = '===>'
===>
===># Yep
, But in this session only....
===>
======

When debugging, this code runs:

// Only defined if interactive, see https://docs.python.org/2/library/sys.html#sys.ps1
    public PyObject ps1 = PyAttributeDeleted.INSTANCE;
    public PyObject ps2 = PyAttributeDeleted.INSTANCE;

So, these two are set as type  PyAttribute Deleted at first, but they change to PyString, and could that be the reason they show up when calling the dir(sys) function?

I do see that  sys and PySystemState both return the same lis.

Still thinking....
History
Date User Action Args
2018-05-07 17:05:53psykiatrissetmessageid: <1525712753.78.0.682650639539.issue2305@psf.upfronthosting.co.za>
2018-05-07 17:05:53psykiatrissetrecipients: + psykiatris, zyasoft, jeff.allen, Arfrever
2018-05-07 17:05:53psykiatrislinkissue2305 messages
2018-05-07 17:05:53psykiatriscreate