#jython IRC Log

Index

IRC Log for 2016-12-07

Timestamps are in GMT/BST.

[1:49] * xemdetia (xemdetia@nat/ibm/x-bpkunbeoaklgofet) Quit (Ping timeout: 260 seconds)
[2:14] * ohumbel (5390f784@gateway/web/freenode/ip.83.144.247.132) Quit (Ping timeout: 260 seconds)
[5:19] * siel (~siel@unaffiliated/motley) Quit (Ping timeout: 260 seconds)
[5:19] * jorgew (sid36089@gateway/web/irccloud.com/x-eeuvzayyxtklsjdr) Quit (Ping timeout: 260 seconds)
[5:20] * eregon (~quassel@2001:41d0:401:3000::29e4) Quit (Ping timeout: 260 seconds)
[5:20] * eregon (~quassel@eregon.me) has joined #jython
[5:20] * siel (~siel@unaffiliated/motley) has joined #jython
[5:27] * jorgew (sid36089@gateway/web/irccloud.com/x-xdhetxetbnezxymh) has joined #jython
[8:05] * clajo04_ (~clajo04@pool-108-46-224-11.nycmny.fios.verizon.net) has joined #jython
[8:06] * clajo04 (~clajo04@pool-108-46-224-11.nycmny.fios.verizon.net) Quit (Ping timeout: 260 seconds)
[8:06] * clajo04_ is now known as clajo04
[8:10] * ohumbel (5390f784@gateway/web/freenode/ip.83.144.247.132) has joined #jython
[10:35] * agronholm (~agronholm@2a00-1190-c00e-0001-021f-d0ff-fead-d185.v6.cust.suomicom.net) Quit (Ping timeout: 245 seconds)
[10:41] * agronholm (~agronholm@188-127-199-138.cust.suomicom.net) has joined #jython
[10:41] * ChanServ sets mode +o agronholm
[12:48] * girish946 (~gsjoshi@183.87.106.82) has joined #jython
[14:00] * girish946 (~gsjoshi@183.87.106.82) Quit (Quit: Leaving)
[15:11] * frostilicus (d0b91876@gateway/web/freenode/ip.208.185.24.118) has joined #jython
[15:11] <frostilicus> hey, anyone here?
[15:19] <xentrac> hi frostilicus!
[15:24] <frostilicus> hey, I was wondering if someone could help me out with the issue posted here: http://stackoverflow.com/questions/41005408/are-java-strings-supposed-to-be-converted-to-a-python-unicode-when-added-to-a-co
[15:24] <frostilicus> The issue seems to be jython converting java Strings to python unicode objects under certain conditions
[15:24] <frostilicus> I'd like to know more about why and when this happens, and if it happens with any other objects
[15:25] <frostilicus> I tried googling but couldn't find any discussion or documentation about why I'm seeing this behavior
[15:28] <frostilicus> xentrac: what do you think?
[15:34] * xemdetia (~xemdetia@129.42.208.167) has joined #jython
[15:56] * xemdetia (~xemdetia@129.42.208.167) Quit (Ping timeout: 265 seconds)
[16:07] <frostilicus> xentrac: still there?
[16:19] <xentrac> hi
[16:19] <xentrac> probably a good example of why it's considered better to start by asking your question rather than asking to ask :)
[16:20] <xentrac> I am pretty sure it happens with many other kinds of Java objects, the ones that have built-in Python equivalents
[16:21] <xentrac> but I too am surprised that it happens when passing a Java object to a Java method of a Java object
[16:21] <xentrac> it might be relevant that the type of the Java method in question has a parameter type of Object
[16:23] <xentrac> presumably if the parameter type were java.lang.String then Jython would at least convert it back to a java.lang.String if not avoid the conversion to Python strings entirely
[16:31] <xentrac> I assume that the thing that is doing the conversion is necessarily the Jython proxy instancemethod generrated by getting the `add` attribute from the (Jython proxy object for the) ArrayList
[16:31] <xentrac> since type() successfully shows that it's a java.lang.String and nota Python string
[16:33] * xemdetia (xemdetia@nat/ibm/x-fetnazowdyznbkdz) has joined #jython
[16:35] <frostilicus> hmm, maybe I'll try some experiments with other objects and methods
[16:39] * xemdetia (xemdetia@nat/ibm/x-fetnazowdyznbkdz) Quit (Ping timeout: 246 seconds)
[16:41] * xemdetia (xemdetia@nat/ibm/x-qjmyhtakmuoxgsjw) has joined #jython
[16:42] <frostilicus> nope, even with a class with the field `private String inner;` and methods: `public String get() { return inner; }` and `public void set(String inner) { this.inner = inner; }` I still get a python unicode from the get method
[16:49] <frostilicus> I added the following method to my class: `public boolean is(String other) { return inner == other }` and that returns True when I call `b.set(a); b.is(a)`
[18:53] * xemdetia (xemdetia@nat/ibm/x-qjmyhtakmuoxgsjw) Quit (Remote host closed the connection)
[18:54] * xemdetia (xemdetia@nat/ibm/x-ujhmvzdhemdddiji) has joined #jython
[19:08] * maxpowa (~maxpowa@107.150.39.146) Quit (Quit: Ahh! My head is on fire!)
[19:08] * maxpowa (~maxpowa@2604:4300:a:132::dead:c0de) has joined #jython
[19:16] * frostilicus (d0b91876@gateway/web/freenode/ip.208.185.24.118) Quit (Quit: Page closed)
[19:26] <xentrac> that's a different situation though
[19:27] <xentrac> but it does suggest that directly invoking the String constructor from Jython is special
[19:28] <xentrac> it seems likely that Jython's string object wraps a java.lang.String, which would explain why .is(a) returs true
[22:10] <gsnedders> (It does)
[22:44] <xentrac> (sorry for not having looked)

Index

These logs were automatically created by JythonLogBot on irc.freenode.net using a slightly modified version of the Java IRC LogBot.