#jython IRC Log

Index

IRC Log for 2014-03-13

Timestamps are in GMT/BST.

[0:02] * Dabuti (~dabuti@217.216.36.215.dyn.user.ono.com) has joined #jython
[0:17] * Dabuti (~dabuti@217.216.36.215.dyn.user.ono.com) Quit (Quit: Saliendo)
[0:32] * diametric (~diametric@2604:3400:dc1:43:216:3eff:fe27:bf9d) Quit (Ping timeout: 265 seconds)
[0:33] * siel_ (~siel@unaffiliated/motley) has joined #jython
[0:34] * siel (~siel@unaffiliated/motley) Quit (Ping timeout: 265 seconds)
[0:37] * diametric (~diametric@2604:3400:dc1:43:216:3eff:fe27:bf9d) has joined #jython
[0:40] * siel_ is now known as siel
[0:52] * lopex (uid4272@gateway/web/irccloud.com/x-ppcdipstpalcqhue) Quit (Read error: Network is unreachable)
[0:53] * Guest17399 (uid4272@gateway/web/irccloud.com/x-dieaavmejlnjbjvx) has joined #jython
[0:53] * Thev00d00 (~v00d00@89.206.161.76) has joined #jython
[0:53] * Thev00d00 (~v00d00@89.206.161.76) Quit (Changing host)
[0:53] * Thev00d00 (~v00d00@gentoo/developer/TheV00d00) has joined #jython
[0:54] * Guest17399 is now known as lopex
[0:55] * Thev00d00|2 (~v00d00@89.206.161.76) Quit (Ping timeout: 264 seconds)
[1:37] * ParahSailin (~parahsail@unaffiliated/parahsailin) has joined #jython
[1:39] <ParahSailin> im not sure if None objects get turned into Java's null when you make insert them as a value in a Java collection. probably not, right?
[1:40] <ParahSailin> when i inspect that from jython, it looks the same as the real thing, but that would just be the pyproxy trick?
[2:59] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Read error: Connection reset by peer)
[4:11] * ArcTanSusan (~susantan@c-50-136-229-251.hsd1.ca.comcast.net) has joined #jython
[5:44] * ParahSailin (~parahsail@unaffiliated/parahsailin) Quit (Ping timeout: 240 seconds)
[5:48] * ParahSailin (~parahsail@unaffiliated/parahsailin) has joined #jython
[6:25] * lheuer (~Adium@f049079036.adsl.alicedsl.de) has joined #jython
[6:25] * lheuer (~Adium@f049079036.adsl.alicedsl.de) Quit (Changing host)
[6:25] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[7:22] * ArcTanSusan (~susantan@c-50-136-229-251.hsd1.ca.comcast.net) Quit (Quit: ArcTanSusan)
[10:02] * lazybear_ (~lazybear@radium.atom.fi) has joined #jython
[10:02] * lazybear (~lazybear@radium.atom.fi) Quit (Ping timeout: 264 seconds)
[10:02] * lazybear_ is now known as lazybear
[12:48] * smaudet (~smaudet@206-51-157-254.nktelco.net) has joined #jython
[13:21] * clajo04 (~clajo04@pool-108-21-222-14.nycmny.fios.verizon.net) Quit (Quit: clajo04)
[14:28] * lheuer (~Adium@unaffiliated/lheuer) Quit (Quit: Leaving.)
[14:28] * lheuer (~Adium@f049079036.adsl.alicedsl.de) has joined #jython
[14:28] * lheuer (~Adium@f049079036.adsl.alicedsl.de) Quit (Changing host)
[14:28] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[14:47] <jimbaker> ParahSailin, it is possible to have PyNone visible in your java collections (this is what this specific jython runtime object is called in java space), but it would take some work. usually it is completely transparent
[14:47] <jimbaker> so i think you're good
[14:56] * Thev00d00|2 (~v00d00@89.206.161.76) has joined #jython
[15:08] * Thev00d00 (~v00d00@gentoo/developer/TheV00d00) Quit (Remote host closed the connection)
[16:14] <ParahSailin> i want the value to be null rather than Py.None for java interop
[16:14] <ParahSailin> i ended up just making an explicit java function to be imported just to be careful
[16:58] <jimbaker> ParahSailin, i really doubt you're going to run into issues. but assertions/casts can be a good backup on assumptions
[17:00] <ParahSailin> hm so if i say `derp = HashMap(dict{u"key1":None}) ` then when i feed derp to a java function that is checking if derp["key"] == null that should succeed?
[17:01] <ParahSailin> s/dict//
[17:07] <jimbaker> ParahSailin, yes, that should convert as you mention
[17:08] <ParahSailin> ah, wild
[17:09] <ParahSailin> i think this should be documented as this is not exactly specified whether the java representation would be a Py.None or null
[17:10] <ParahSailin> because presumably in the PyDict, the value is Py.None, right?
[17:10] <jimbaker> yes, it has to be
[17:11] <ParahSailin> and unless there is some weird overloading of the HashMap constructor, the Collection instance of PyDict would just feed the actual PyObject into it
[17:11] <jimbaker> when in doubt, i look at the source: private final ConcurrentMap<PyObject, PyObject> internalMap;
[17:15] <jimbaker> then i might take a look at some interaction in the jython console: https://gist.github.com/jimbaker/9532639
[17:16] <ParahSailin> HashMap(Map<? extends K,? extends V> m) would presumably just receive PyObjects for both K and V
[17:17] <jimbaker> need less to say, if i then say z = dict(y) in that example, it converts back to {u'b': None, u'a': 42} - perhaps the more surprising aspect is that we always use unicode when going from java. but in general, python's conversion semantics around unicode/str make this fine
[17:18] <jimbaker> jython ignores that type signature
[17:19] <jimbaker> such type signatures can be accessed and reflected upon in java, but ordinarily that's what seen in java linkage as well
[17:20] <ParahSailin> oh... Py.None is implemented as just static null pointer
[17:20] <ParahSailin> i was assuming that it was some sort of atom like a bool
[17:21] <jimbaker> not certain what you mean... it actually is a singleton object
[17:22] <jimbaker> public static PyObject None;
[17:23] <ParahSailin> ok, then still not sure at what point it gets converted into null pointer
[17:23] <jimbaker> sure, take a look at org.python.core.PyNone
[17:24] <ParahSailin> ok, __tojava__
[17:24] <jimbaker> specifically __tojava__
[17:24] <ParahSailin> so this is called by the runtime whenever a PyObject is fed to java
[17:24] <ParahSailin> makes sense now
[17:25] <jimbaker> exactly. we have very explicit entry and exit points we maintain between java space and python space
[17:25] <jimbaker> at some extra overhead, of course
[17:25] <ParahSailin> is there a __fromjava__?
[17:26] <jimbaker> look at this method, Py.java2py
[17:27] <jimbaker> that's the entry point into the boxer
[17:28] <jimbaker> which has a fair amount of complexity. but that's where you would start, much like any java object coming into python space ;)
[17:28] <ParahSailin> ok
[17:28] <ParahSailin> yeah ive had to call java2py a couple times
[17:29] * ArcTanSusan (~susantan@50-203-159-62-static.hfc.comcastbusiness.net) has joined #jython
[19:01] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[19:24] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Read error: Connection reset by peer)
[19:25] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[19:35] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Remote host closed the connection)
[19:42] * clajo04 (~clajo04@pool-108-21-222-14.nycmny.fios.verizon.net) has joined #jython
[20:16] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[21:07] * smaudet (~smaudet@206-51-157-254.nktelco.net) Quit (Read error: Connection reset by peer)
[21:07] * smaudet (~smaudet@206-51-157-254.nktelco.net) has joined #jython
[21:12] * smaudet (~smaudet@206-51-157-254.nktelco.net) Quit (Ping timeout: 246 seconds)
[21:18] * clajo04 (~clajo04@pool-108-21-222-14.nycmny.fios.verizon.net) Quit (Quit: clajo04)
[21:20] * clajo04 (~clajo04@pool-108-21-222-14.nycmny.fios.verizon.net) has joined #jython
[21:38] * smaudet (~smaudet@cpe-98-28-34-149.columbus.res.rr.com) has joined #jython
[22:21] * sinistersnare (~sinisters@pool-108-28-93-153.washdc.fios.verizon.net) has joined #jython
[22:54] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 240 seconds)

Index

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