#jython IRC Log (v0.9)


IRC Log for 2010-11-12

Timestamps are in GMT/BST.

[0:01] <pr3d4t0r> cyril_: :D
[0:05] <pr3d4t0r> cyril_: Let me know how else I can help.
[0:12] * jimbaker (~jimbaker@c-67-190-49-237.hsd1.co.comcast.net) Quit (Quit: jimbaker)
[0:19] * jimbaker (~jimbaker@184-96-38-253.hlrn.qwest.net) has joined #jython
[0:19] * jimbaker (~jimbaker@184-96-38-253.hlrn.qwest.net) Quit (Client Quit)
[0:21] * jimbaker (~jimbaker@184-96-38-253.hlrn.qwest.net) has joined #jython
[0:22] <cyril_> pr3d4t0r, Well, actually, I'm wondering if Jython is strictly "equivalent" to the regular Python
[0:22] <cyril_> pr3d4t0r, I'm having trouble when importing python modules that use annotations, for example
[0:22] <jimbaker> cyril_: you mean decorators?
[0:23] <jimbaker> cyril_: jython has a slight superset of functionality over the python language
[0:23] <cyril_> pr3d4t0r, right, I got mixed up with Java's annotations
[0:23] <jimbaker> it's also missing some chunks of the stdlib. some of these we will implement. some we will never implement
[0:24] <jimbaker> but if it's language/builtin type, file a bug. those we must fix. in general, i don't think you will find it with respect to decorators, those are actually pretty simple
[0:25] <pr3d4t0r> cyril_: Jython is 2.5 compliant. If you can do it in CPython, you can do it in Jython *unless* your original Python code uses some C extension.
[0:25] <pr3d4t0r> cyril_: All our code runs on both Jython and CPython. In fact, we develop using CPython 2.6, then backport.
[0:25] <pr3d4t0r> cyril_: The changes are minor. For example, for JSON support (added in 2.6) we have to do something like:
[0:26] <pr3d4t0r> cyril_: import simplejson as json
[0:26] <pr3d4t0r> cyril_: Then proceed as usual.
[0:26] <cyril_> oh, actually I use Python 2.7. Could this be a problem ?
[0:26] <jimbaker> pr3d4t0r: one thing you can do in that case is anyjson
[0:26] <jimbaker> pretty nice package
[0:26] <jimbaker> cyril_: sounds very much like a possibility. you're definitely on the leading edge :)
[0:27] <pr3d4t0r> jimbaker: Hrm... maybe.
[0:27] <pr3d4t0r> jimbaker: I like our approach better because we just need to remove the first line and the rest of the code will work from 2.6 upward.
[0:28] <cyril_> OK, I'll try to use Python 2.6.6
[0:28] <jimbaker> cyril_: jython 2.5 is a superset of python 2.5. it does include class 2.6 functionality - class decorators and mutable ast
[0:29] <jimbaker> sorry, jython 2.6 functionality
[0:33] <cyril_> Ok, I should use Jython 2.5.1 rather than Jython 2.2.1 for a start
[0:34] * jimbaker (~jimbaker@184-96-38-253.hlrn.qwest.net) Quit (Quit: jimbaker)
[0:44] <pr3d4t0r> cyril_: Use Jython 2.5.2 current release candidate.
[0:45] <pr3d4t0r> cyril_: The official Jython 2.5.1 release has bugs that may affect your scripting factory.
[0:47] <cyril_> pr3d4t0r, Ok, thanks for the tip, I'm downloading that
[0:47] <pr3d4t0r> cyril_: Cheers.
[0:49] <cyril_> pr3d4t0r, Is it safe to do something like :
[0:49] <cyril_> sys.path.extend(<sys.path from Python2.6>)
[0:49] <cyril_> in order for Jython to use my currently installed Python modules ?
[1:01] <cyril_> Oh, the "format" method was backported to Python 2.6, but does not seem to work with Jython 2.5.2
[1:07] <pr3d4t0r> cyril_: sys.path.append(path here)
[1:08] <pr3d4t0r> cyril_: And no, that's unsafe.
[1:08] <cyril_> pr3d4t0r, Well, how could I use the modules I need in a safe way ?
[1:09] <pr3d4t0r> cyril_: Set them in your own path, add that to the Jython path or use sys.path.append()
[1:09] <pr3d4t0r> cyril_: What we've been doing is running this from a common Java path context (e.g. the cwd from where we start the Java app).
[1:09] <pr3d4t0r> cyril_: We have the path set to use . as the first path it looks at.
[1:10] <pr3d4t0r> cyril_: Then we place all the Python source (NOT the .egg or installed files) there, and let Jython do its thing.
[1:10] <pr3d4t0r> cyril_: If we need to package that, then we use the jar tool.
[1:10] * plankton (~peretto@ has joined #jython
[1:13] <cyril_> So, basically, I can't really install a module ("python setup.py install", for example) ?
[1:17] <pr3d4t0r> cyril_: No, I wouldn't trust that on Jython.
[1:17] <pr3d4t0r> cyril_: Two reasons:
[1:17] <pr3d4t0r> cyril_: 1. A regular installer may include C code that you can't run from Jython.
[1:18] <pr3d4t0r> cyril_: 2. The installer is looking at the Python standard environment variables, which differ from Jython's.
[1:18] <pr3d4t0r> cyril_: So unless you remember to override all of them, you may get yourself hosed.
[1:18] <cyril_> hahah
[1:18] <cyril_> Ok
[1:19] <pr3d4t0r> cyril_: Safer to put everything in a path that you know about, then .jar the .class files to distribute with your app.
[1:20] <cyril_> Should I generate the .class files from my Python files using a tool like Jythonc ?
[1:20] <pr3d4t0r> cyril_: No.
[1:20] <cyril_> I must admit I'm kinda lost.
[1:20] <pr3d4t0r> cyril_: Jython generates them as you run the code, or you can use some command line argument.
[1:20] <pr3d4t0r> cyril_: Dude.
[1:20] <pr3d4t0r> cyril_: It's easy.
[1:20] <pr3d4t0r> cyril_: Kill the Batman.
[1:21] <pr3d4t0r> cyril_: Er...
[1:21] <cyril_> mouahahahahah
[1:21] <cyril_> Dude, I'm laughing my ass off at 2am
[1:21] <pr3d4t0r> cyril_: Just set everything under a single directory structure in your classpath and you're off to the races.
[1:21] <pr3d4t0r> cyril_: Don't over think this.
[1:21] <cyril_> yep but it means I have to get my Python library's source code, plus all its dependencies' source code
[1:22] <cyril_> put all that in a single directory in my class path
[1:22] <pr3d4t0r> cyril_: Assume that Jython == Python, until you need to do some Java-specific thing. Otherwise you'll go insane (and drive us nuts) discussing implementation minutae that ultimately don't help you get where you need to be.
[1:22] <pr3d4t0r> cyril_: Not everything in a single directory.
[1:22] <pr3d4t0r> cyril_: Everything UNDER a single directory. Big difference.
[1:22] <pr3d4t0r> cyril_: Your packages and so on should live there.
[1:22] <pr3d4t0r> cyril_: Let me show you how this works. Please stand by.
[1:25] <pr3d4t0r> cyril_: Yo'.
[1:25] <pr3d4t0r> cyril_: http://eugeneciurana.com/pastebin/pastebin.php?show=43540
[1:26] * plankton (~peretto@ Quit ()
[1:26] <pr3d4t0r> cyril_: That's a standard Java directory for a container. All the .jar files you see there are in the classpath automatically.
[1:26] <pr3d4t0r> cyril_: Notice that I put to regular Python packages there: Suds (great for SOAP/WSDL stuff) and PyMongo.
[1:27] <pr3d4t0r> cyril_: Since they're in the classpath already, from my code I can simply use the regular import statements without having to specify a path.
[1:27] <pr3d4t0r> cyril_: No mucking with JYTHON_WHATEVER environment variables, no mucking with sys.path.append()
[1:28] <cyril_> pr3d4t0r, ok, so the pymongo directory is just a copy of the module's source ?
[1:28] <pr3d4t0r> cyril_: The standard Java class loader + Jython "know" to look into my default user classes directory (line 2) and load everything automagically.
[1:28] <pr3d4t0r> cyril_: Yeah, that's the standard PyMongo stuff from mongoDB.
[1:29] <pr3d4t0r> cyril_: $CLASSPATH/suds is the standard Suds stuff as well.
[1:29] <cyril_> pr3d4t0r, ok, so you need to copy/paste the sources of the library, and of its dependencies here. That must be hell to maintain, isn't it ?
[1:29] <pr3d4t0r> cyril_: No.
[1:30] <pr3d4t0r> cyril_: Download the source from the original, install, done.
[1:30] <pr3d4t0r> cyril_: It's no different from setting it up on a Python installation. The only difference is *where* you put it.
[1:30] <pr3d4t0r> cyril_: I think Suds I installed using setup.py and then just copied the directories over.
[1:31] <pr3d4t0r> cyril_: And you can see here EXACTLY why it's important to NOT use setup.py with Jython.
[1:31] <cyril_> pr3d4t0r, yep, but let's say you need the "foo" library. The user gets a copy of that library when using your pieceof software, even though he might already have it installed on his system
[1:31] <pr3d4t0r> cyril_: Lines 26 and 27. There's some C code in there.
[1:31] <pr3d4t0r> cyril_: Yup.
[1:31] <pr3d4t0r> cyril_: That's how you ought to do it.
[1:32] <cyril_> pr3d4t0r, and when he updates the library (using apt-get, for example), he wont update yours, and will have to download the next release of your software to get it
[1:32] <pr3d4t0r> cyril_: Because the foo library in their system may have C dependencies that will screw Jython in the arse.
[1:32] <cyril_> wow
[1:32] <cyril_> ok
[1:32] <pr3d4t0r> cyril_: You update your own for Jython land.
[1:32] <cyril_> pr3d4t0r, I think I get it. It is dirty, but I guess this is the only way
[1:34] * pr3d4t0r smacks cyril_
[1:34] <pr3d4t0r> cyril_: It's not dirty. It's clean for the environment you're on :)
[1:35] <cyril_> pr3d4t0r, Yeah :-) But for a young developer like me, it seems weird.
[1:35] <pr3d4t0r> cyril_: I had several conversations with the guys from Canonical who maintain many of the Java packages. Java package management is very different from apt-get package management. See them as different animals. Remember that Java follows different rules.
[1:35] <pr3d4t0r> cyril_: The Java Python run-time (Jython) follows Java rules for packaging/distribution but has CPython behaviours for running code.
[1:36] <cyril_> pr3d4t0r, Oh, I won't. Java is such a weird thing to me...
[1:36] <pr3d4t0r> cyril_: Heh.
[1:36] <pr3d4t0r> cyril_: It just has different rules for how it treats the environment.
[1:37] <cyril_> pr3d4t0r, Sure. I donno why, but I've never been found of Java :( Well, let's get to work.
[1:37] <pr3d4t0r> Hrm... all this typing could make an excellent blog post :)
[1:37] <pr3d4t0r> cyril_: Java is different.
[1:37] <pr3d4t0r> cyril_: Java is very nice if you are doing enterprisey stuff.
[1:38] <pr3d4t0r> cyril_: And if you want tight control over how you lay out your app, its components, etc. Java is amazing for that.
[1:38] <cyril_> pr3d4t0r, Damn, Python seems like a thousand times nicer to me
[1:38] <cyril_> pr3d4t0r, But, well, I'm probably not an "enterprisey" guy
[1:38] <pr3d4t0r> cyril_: You just have to learn to think in Java terms. Java is its own little black box that occasionally lets you play with the underlying infrastructure, but more often than not, it doesn't :)
[1:39] <cyril_> pr3d4t0r, And you happen to like both languages ? :p
[1:39] <pr3d4t0r> cyril_: Of course.
[1:39] <cyril_> pr3d4t0r, If you ever write a blog post about that, gimme a link :p
[1:39] <pr3d4t0r> cyril_: Python isn't good for everything. Java isn't good for everything. awk isn't good for everything.
[1:39] <pr3d4t0r> cyril_: $LANGUAGE isn't good for everything.
[1:39] <cyril_> pr3d4t0r, one size cant fit them all, right ?
[1:39] <pr3d4t0r> cyril_: Never.
[1:40] <pr3d4t0r> cyril_: The last attempt at that was Ada ;)
[1:40] <cyril_> pr3d4t0r, hahaha, Ada. I'm too young to have ever programmed in Ada
[1:40] <pr3d4t0r> cyril_: Here: http://ciurana.livejournal.com/5974.html
[1:41] <pr3d4t0r> cyril_: Side-by-side comparison of how awk beats the crap out of Python for some apps, and probablly matches or exceeds Java's performance for the same problem domain.
[2:11] <cyril_> pr3d4t0r, Well anyway, thanks a lot. Now it's down to a pure Python problem, which is what I like :-)
[2:14] * jimbaker (~jimbaker@c-24-8-39-78.hsd1.co.comcast.net) has joined #jython
[3:31] * shanka (~shashank@c-98-245-87-8.hsd1.co.comcast.net) Quit (Read error: Connection reset by peer)
[3:32] * shanka (~shashank@c-98-245-87-8.hsd1.co.comcast.net) has joined #jython
[3:50] * shanka (~shashank@c-98-245-87-8.hsd1.co.comcast.net) Quit (Ping timeout: 245 seconds)
[3:54] * njoyce (~njoyce@124-150-87-139.dyn.iinet.net.au) Quit (Remote host closed the connection)
[3:56] * njoyce (~njoyce@124-150-87-139.dyn.iinet.net.au) has joined #jython
[4:03] * groves (~groves@nat.earth.threerings.net) Quit (Ping timeout: 245 seconds)
[4:20] * njoyce (~njoyce@124-150-87-139.dyn.iinet.net.au) Quit (Ping timeout: 265 seconds)
[4:21] * njoyce (~njoyce@203-214-98-238.dyn.iinet.net.au) has joined #jython
[4:23] * shanka (~shashank@c-98-245-87-8.hsd1.co.comcast.net) has joined #jython
[5:07] * njoyce (~njoyce@203-214-98-238.dyn.iinet.net.au) Quit (Ping timeout: 255 seconds)
[5:12] * lolsuper_ (~super_@unaffiliated/lolsuper-/x-9881387) Quit (Ping timeout: 245 seconds)
[5:20] * njoyce (~njoyce@203-214-101-191.dyn.iinet.net.au) has joined #jython
[6:48] * yacc (~andreas@ Quit (Ping timeout: 255 seconds)
[7:15] * mcella (~mcella@ has joined #jython
[7:18] * groves (~groves@2002:47cc:b55b:0:221:e9ff:fee5:eac1) has joined #jython
[8:34] * thobe (~Adium@212-162-171-110.skbbip.com) has joined #jython
[8:35] * mcella (~mcella@ Quit (Read error: Connection reset by peer)
[8:37] * lolsuper_ (~super_@unaffiliated/lolsuper-/x-9881387) has joined #jython
[8:43] * yacc (~andreas@ has joined #jython
[8:55] * Imek (~joe@host-195-188-251-108.reversezone.co.uk) has joined #jython
[8:58] * Imek (~joe@host-195-188-251-108.reversezone.co.uk) Quit (Client Quit)
[8:58] * Imek (~joe@host-195-188-251-108.reversezone.co.uk) has joined #jython
[9:10] * lolsuper_ (~super_@unaffiliated/lolsuper-/x-9881387) Quit (Ping timeout: 245 seconds)
[9:16] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[10:34] * lolsuper_ (~super_@unaffiliated/lolsuper-/x-9881387) has joined #jython
[11:07] * lolsuper_ (~super_@unaffiliated/lolsuper-/x-9881387) Quit (Ping timeout: 245 seconds)
[12:24] * lucian_ (~lucian@78-86-217-168.zone2.bethere.co.uk) has joined #jython
[12:27] * JStoker (jstoker@unaffiliated/jstoker) Quit (Quit: JStoker is gone :()
[12:45] * shanka (~shashank@c-98-245-87-8.hsd1.co.comcast.net) Quit (Quit: Leaving.)
[13:50] * clajo04_ (~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net) Quit (Quit: clajo04_)
[13:50] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) Quit (Read error: Connection reset by peer)
[13:50] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[14:00] * clajo04_ (~clajo04_@pool-74-108-95-175.nycmny.fios.verizon.net) has joined #jython
[14:06] * JStoker (jstoker@unaffiliated/jstoker) has joined #jython
[14:13] * jimbaker (~jimbaker@c-24-8-39-78.hsd1.co.comcast.net) Quit (Read error: Connection reset by peer)
[14:14] * jimbaker (~jimbaker@c-24-8-39-78.hsd1.co.comcast.net) has joined #jython
[14:48] * jimbaker (~jimbaker@c-24-8-39-78.hsd1.co.comcast.net) Quit (Quit: jimbaker)
[15:01] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) Quit (Read error: Connection reset by peer)
[15:01] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[15:06] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) Quit (Client Quit)
[15:07] * enebo (~enebo@c69-58-70-2.cust.broadbandip.net) has joined #jython
[15:28] * thobe (~Adium@212-162-171-110.skbbip.com) Quit (Quit: Leaving.)
[15:37] * skay (~Adium@c-71-239-171-114.hsd1.il.comcast.net) has joined #jython
[15:55] * adiroiban (~adiroiban@ has joined #jython
[16:10] * skay (~Adium@c-71-239-171-114.hsd1.il.comcast.net) Quit (Quit: Leaving.)
[16:20] * jimbaker (~jimbaker@ has joined #jython
[16:21] * jimbaker (~jimbaker@ Quit (Client Quit)
[16:23] * jimbaker (~jimbaker@ has joined #jython
[16:26] * lucian_ (~lucian@78-86-217-168.zone2.bethere.co.uk) Quit (Remote host closed the connection)
[16:30] * ohumbel (5390f2dc@gateway/web/freenode/ip. Quit (Quit: Page closed)
[16:35] * ohumbel (5390f2dc@gateway/web/freenode/ip. has joined #jython
[16:50] * lucian_ (~lucian@78-86-217-168.zone2.bethere.co.uk) has joined #jython
[17:01] * lucian_ (~lucian@78-86-217-168.zone2.bethere.co.uk) Quit (Remote host closed the connection)
[17:29] * lucian_ (~lucian@78-86-217-168.zone2.bethere.co.uk) has joined #jython
[17:35] * lopex (lopex@chello089076044027.chello.pl) has joined #jython
[17:50] * shanka (~shashank@c-98-245-87-8.hsd1.co.comcast.net) has joined #jython
[17:51] * groves (~groves@2002:47cc:b55b:0:221:e9ff:fee5:eac1) Quit (Ping timeout: 272 seconds)
[17:59] * Imek (~joe@host-195-188-251-108.reversezone.co.uk) Quit (Quit: Good night, and have a pleasant tomorrow.)
[18:04] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[18:27] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) Quit (Read error: Connection reset by peer)
[18:28] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[19:19] * headius (~headius@c69-58-69-2.cust.broadbandip.net) has joined #jython
[19:28] * stakkars (~tismer@i59F7DEB0.versanet.de) Quit (Ping timeout: 260 seconds)
[19:33] * groves (~groves@nat.earth.threerings.net) has joined #jython
[19:34] * stakkars (~tismer@i59F7F408.versanet.de) has joined #jython
[19:39] * jcp (~jw@bzflag/contributor/javawizard2539) Quit (Ping timeout: 276 seconds)
[20:02] * headius (~headius@c69-58-69-2.cust.broadbandip.net) Quit (Quit: headius)
[20:07] * enebo (~enebo@c69-58-70-2.cust.broadbandip.net) Quit (Quit: enebo)
[20:17] * headius (~headius@c69-58-69-2.cust.broadbandip.net) has joined #jython
[20:25] * jcp (~jw@bzflag/contributor/javawizard2539) has joined #jython
[20:26] * headius (~headius@c69-58-69-2.cust.broadbandip.net) Quit (Quit: headius)
[20:28] * adiroiban (~adiroiban@ Quit (Ping timeout: 255 seconds)
[20:44] * shanka (~shashank@c-98-245-87-8.hsd1.co.comcast.net) Quit (Ping timeout: 240 seconds)
[20:45] * jimbaker (~jimbaker@ Quit (Quit: jimbaker)
[21:05] * shanka (~shashank@ucb-np1-24.colorado.edu) has joined #jython
[21:16] * headius (~headius@c69-58-70-2.cust.broadbandip.net) has joined #jython
[21:21] * enebo (~enebo@c69-58-70-2.cust.broadbandip.net) has joined #jython
[21:23] * iq (~iq@unaffiliated/iq) has joined #jython
[21:36] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) Quit (Read error: Connection reset by peer)
[21:36] * jabley_ (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[21:41] <iq> Hi, Is there an archtecture diagram available for Jython? Looking for someting that shows where it fits with JVM, Jython Ibrares, etc.
[21:42] * headius (~headius@c69-58-70-2.cust.broadbandip.net) Quit (Quit: headius)
[22:08] * shanka (~shashank@ucb-np1-24.colorado.edu) Quit (Ping timeout: 240 seconds)
[22:27] * jimbaker (~jimbaker@ has joined #jython
[22:36] * shanka (~shashank@c-98-245-87-8.hsd1.co.comcast.net) has joined #jython
[22:36] * lolsuper_ (~super_@unaffiliated/lolsuper-/x-9881387) has joined #jython
[22:45] * enebo (~enebo@c69-58-70-2.cust.broadbandip.net) Quit (Quit: enebo)
[22:54] * enebo (~enebo@c69-58-70-2.cust.broadbandip.net) has joined #jython
[23:08] * jabley_ (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) Quit (Read error: Connection reset by peer)
[23:09] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) has joined #jython
[23:11] * lolsuper_ (~super_@unaffiliated/lolsuper-/x-9881387) Quit (Ping timeout: 245 seconds)
[23:14] * jabley (~jabley@cpc1-farn4-0-0-cust318.6-2.cable.virginmedia.com) Quit (Quit: jabley)
[23:30] * lolsuper_ (~super_@unaffiliated/lolsuper-/x-9881387) has joined #jython


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