Custom Search
|
Date: December 31, 2006
From: "John Smith" <recursive68@xxxxxxxxx>
Hi, Given the recent discussion on the list about getting various popular CPython applications running on Jython, I thought I'd try and contribute. I've got web.py running on Jython 2.2.a1 with some minor modifications to the web.py distribution. I've put a posting of the details on the Jython wiki: http://wiki.python.org/jython/JythonMonthly/Articles/January2007/1 Hope it's of use/interest :) Cheers Colin ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 31, 2006
From: "Charlie Groves" <charlie.groves@xxxxxxxxx>
In-reply-to:
<96c4692d0612311050v6b90a691y7fb88d7d1a730079@xxxxxxxxxxxxxx>
References:
<E1Gzwu9-0005cf-RW@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <96c4692d0612311050v6b90a691y7fb88d7d1a730079@xxxxxxxxxxxxxx>
Whoops, meant to send this to jython-dev. ---------- Forwarded message ---------- From: Charlie Groves <charlie.groves@xxxxxxxxx> Date: Dec 31, 2006 1:50 PM Subject: Re: [Jython-checkins] SF.net SVN: jython: [3031] trunk/jython/src/org/python/core/PySystemState. java To: "otmarhumbel@xxxxxxxxxxxxxxxxxxxxx" <otmarhumbel@xxxxxxxxxxxxxxxxxxxxx> Cc: jython-checkins@xxxxxxxxxxxxxxxxxxxxx URLDecoder.decode(String url, String encoding) didn't appear until Java 1.4 so this doesn't compile for 1.2 or 1.3. They only have URLDecoder.decode(String url) Since the bug fixed with that encoding argument is in the 1.2 and 1.3 versions, I'm thinking we should revert this for trunk, but merge it over to the 2.3 branch where we can use Java 1.4 methods. Sound good? Charlie On 12/28/06, otmarhumbel@xxxxxxxxxxxxxxxxxxxxx <otmarhumbel@xxxxxxxxxxxxxxxxxxxxx> wrote: > Revision: 3031 > http://svn.sourceforge.net/jython/?rev=3031&view=rev > Author: otmarhumbel > Date: 2006-12-28 07:10:49 -0800 (Thu, 28 Dec 2006) > > Log Message: > ----------- > use URLDecoder instead of decoding "by hand" > > Modified Paths: > -------------- > trunk/jython/src/org/python/core/PySystemState.java > > Modified: trunk/jython/src/org/python/core/PySystemState.java > =================================================================== > --- trunk/jython/src/org/python/core/PySystemState.java 2006-12-28 15:02:02 > UTC (rev 3030) > +++ trunk/jython/src/org/python/core/PySystemState.java 2006-12-28 15:10:49 > UTC (rev 3031) > @@ -9,7 +9,9 @@ > import java.io.FilterInputStream; > import java.io.IOException; > import java.io.InputStream; > +import java.io.UnsupportedEncodingException; > import java.net.URL; > +import java.net.URLDecoder; > import java.security.AccessControlException; > import java.util.Enumeration; > import java.util.Hashtable; > @@ -31,7 +33,6 @@ > > private static final String JAR_URL_PREFIX = "jar:file:"; > private static final String JAR_SEPARATOR = "!"; > - private static final String URL_BLANK_REPLACEMENT = "%20"; > > private static final String PYTHON_CACHEDIR = "python.cachedir"; > protected static final String PYTHON_CACHEDIR_SKIP = > "python.cachedir.skip"; > @@ -668,20 +669,14 @@ > URL url = thisClass.getResource(className + ".class"); > // we expect an URL like > jar:file:/install_dir/jython.jar!/org/python/core/PySystemState.class > if (url != null) { > - String urlString = url.toString(); > - int jarSeparatorIndex = urlString.indexOf(JAR_SEPARATOR); > - if (urlString.startsWith(JAR_URL_PREFIX) && jarSeparatorIndex > > 0) { > - jarFileName = urlString.substring(JAR_URL_PREFIX.length(), > jarSeparatorIndex); > - // handle directories containing blanks > - // we can't use String.replaceAll before java 1.4, so > instead of the obvious: > - // jarFileName = > jarFileName.replaceAll(URL_BLANK_REPLACEMENT, " "); > - // apply repeated substitutions, which should be safe in > this case > - int URL_BLANK_LOCATION = > jarFileName.indexOf(URL_BLANK_REPLACEMENT); > - while (URL_BLANK_LOCATION >= 0) { > - jarFileName = jarFileName.substring(0, > URL_BLANK_LOCATION) + " " + > - jarFileName.substring(URL_BLANK_LOCATION + > URL_BLANK_REPLACEMENT.length()); > - URL_BLANK_LOCATION = > jarFileName.indexOf(URL_BLANK_REPLACEMENT); > + try { > + String urlString = URLDecoder.decode(url.toString(), > "UTF-8"); > + int jarSeparatorIndex = urlString.indexOf(JAR_SEPARATOR); > + if (urlString.startsWith(JAR_URL_PREFIX) && > jarSeparatorIndex > 0) { > + jarFileName = > urlString.substring(JAR_URL_PREFIX.length(), jarSeparatorIndex); > } > + } catch (UnsupportedEncodingException e) { > + // this is VERY unlikely - forget about standalone if it > happens > } > } > return jarFileName; > > > This was sent by the SourceForge.net collaborative development platform, the > world's largest Open Source development site. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-checkins mailing list > Jython-checkins@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/jython-checkins > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 31, 2006
From: "Charlie Groves" <charlie.groves@xxxxxxxxx>
In-reply-to:
<45969C18.4030706@xxxxxxxxxxxxx>
References:
<45969C18.4030706@xxxxxxxxxxxxx>
On 12/30/06, Paul Drummond <paul.drummond@xxxxxxxxxxxxx> wrote: >Is PyObject.__iter__() the correct > equivalent in Jython? The thing is, it throws an exception if the > object is not iterable, so testing for null is pointless is it not? Yep. Call __iter__() and catch the type error if you want to try to iterate, but can do something differently if it's not iterable. If you want to fail if an object isn't iterable(ie it's an argument that should've been iterable), use the iter method in Py.java. It allows you to pass in a possibly iterable object and a message to use in a type error if it isn't iterable. You get the iterator back if it is, or it throws a type error with your message if it isn't. You can see how to check if a type error is thrown there as well. Charlie ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 30, 2006
From: Paul Drummond <paul.drummond@xxxxxxxxxxxxx>
Hi all, What is the correct way to check whether an object is an iterator in Jython. In CPython I'd do: iter(obj) != null which I guess is the correct test? Is PyObject.__iter__() the correct equivalent in Jython? The thing is, it throws an exception if the object is not iterable, so testing for null is pointless is it not? ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 28, 2006
From: Leo User <leouser126@xxxxxxxxx>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Jython-dev mailing list Jython-dev@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/jython-dev
Date: December 28, 2006
From: Charles Oliver Nutter <charles.nutter@xxxxxxx>
In-reply-to:
<ba90a0a90612211422w456bad4w56a5c61729a6b0de@xxxxxxxxxxxxxx>
References:
<4560A20A.8030701@xxxxxxx> <4571C37C.5000407@xxxxxxx> <ba90a0a90612211422w456bad4w56a5c61729a6b0de@xxxxxxxxxxxxxx>
Oti wrote: > Hi Charles, others, > > I submitted a paper with the title "Jython and Java: Plug & Play". > My aim is to show show how well Java and Jython interact. > > Since I have no experience in submitting papers, I have no idea if it > has a chance to be accepted.. > And - second - if my company will let me go. Excellent. If there's anything I can do to help your paper get in or help you present, I'll try to do it. I'd love to have more dynamic languages than just Groovy be well represented. -- Charles Oliver Nutter, JRuby Core Developer Blogging on Ruby and Java @ headius.blogspot.com Help spec out Ruby today! @ www.headius.com/rubyspec headius@xxxxxxxxxxx -- charles.nutter@xxxxxxx ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 26, 2006
From: Samuele Pedroni <pedronis@xxxxxxxxxxxxxxxxxx>
In-reply-to:
<457C0221.9090709@xxxxxxxxxxxxxxxxxx>
References:
<96c4692d0611282239s29618026j724d954dd64ed431@xxxxxxxxxxxxxx> <456D6FE9.7010004@xxxxxxxxxx> <456D725F.4050006@xxxxxxxxxx> <45748FAF.3020706@xxxxxxxxxx> <457AF66E.9040106@xxxxxxxxxxxxxxxxxx> <4dab5f760612091121u1ddec83chd86c3f602df222ef@xxxxxxxxxxxxxx> <457B245A.9090909@xxxxxxxxxxxxxxxxxx> <96c4692d0612092242x3caf98e4ieb5f04d25d980cd2@xxxxxxxxxxxxxx> <457C0221.9090709@xxxxxxxxxxxxxxxxxx>
Samuele Pedroni wrote: > > this is happening because str has no __mod__ exposed has a descriptor, > given how the mixed type lookup works now if builtin types don't expose > all the descriptors they should we may get this kind of failures. > In r3029 I have checked in on the trunk some tools that may help tracking the situation about this. Given that what we implement currently is a mixture of 2.2/2.3: you need to take reports of jython checker22.py jython checker23.py (the checkers are generated with python2.x make_checker.py) and interpolate, also some problems are benign, each one should be analyzed. If someone wants to look at some of these and has doubts feel free to post questions to me here. As I say in the check-in this is not doing a complete check, also the output may be confusing at times, is a start tough. regards. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 26, 2006
From: "Leo Soto M." <leo.soto@xxxxxxxxx>
Hi all,
I've been throwing some bits of python code to jython to see how near
it is to be usable to my purposes. It has been fun by now, as the
failed tests forced me to start looking on the Jython code :).
One thing that I discovered is that even when an import fails jython
saves the result on sys.modules, setting the new entry to Py.None
(arround the middle of imp.import_name) . That's different to what
CPython does (AFAICS, import.c:mark_miss only saves failed relative
imports), and in the practice it doesn't allow the following trick,
which works under CPython2.3 :
try:
import foo
except ImportError:
download_from_somewhere('foo.zip')
sys.path.append('foo.zip')
import foo
What's the reason behind this behaviour? Performance alone? Can we
change it to mimic CPython behaviour?
--
Leo Soto M.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: "Khalid Zuberi" <kzuberi@xxxxxxxxx>
In-reply-to:
<728316.44472.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
References:
<728316.44472.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
On 12/22/06, Leo User <leouser126@xxxxxxxxx> wrote: > Hi folks, > > Ive been investigating: > http://sourceforge.net/tracker/index.php?func=detail&aid=1604258&group_id=12867&atid=112867 > > one of the problems appears that the copy module is > not up to the 2.2 level. By moving it to 2.2, a > crucial step in solving the problem seems to be > solved. So I guess I need to ask, is there a way to > find out what version a module is besides looking at > Lib modules and comparing them to Pythons modules? Im > a little suspicious that other things may be behind > the 2.2 line. > Nice catch. The only thing i know to go on is the svn history. In this case the commit message from copy.py is helpful: """ Added a patched version of copy.py. Hopefully this copy can be removed again in 2.2 when CPython patch #442351 is applied and CPython-2.2 is released. """ So I guess a todo task is to review the patched versions of modules we are carrying in Lib to see if we need to merge in changes from their 2.2 counterparts (or see if we can return to a version from the CPythonLib dir if the fix that originally prompted the separate jython version is no longer an issue). Should open a tracker item for this as a reminder. Note, as has come up before, some modules in Lib have actually been updated with changes ported back from 2.3 (at least test/test_descr.py). - kz ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: Leo User <leouser126@xxxxxxxxx>
Hi folks, Ive been investigating: http://sourceforge.net/tracker/index.php?func=detail&aid=1604258&group_id=12867&atid=112867 one of the problems appears that the copy module is not up to the 2.2 level. By moving it to 2.2, a crucial step in solving the problem seems to be solved. So I guess I need to ask, is there a way to find out what version a module is besides looking at Lib modules and comparing them to Pythons modules? Im a little suspicious that other things may be behind the 2.2 line. leouser __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: "Tiago Antão" <tiagoantao@xxxxxxxxx>
In-reply-to:
<458A96B8.1050007@xxxxxxxxxxxxxxxxxxxxxxx>
References:
<6d941f120612210215p130be96ia831d9b5d2b54948@xxxxxxxxxxxxxx> <458A96B8.1050007@xxxxxxxxxxxxxxxxxxxxxxx>
Hi! I was using the trunk, not 2.3, my bad, sorry. Another problem that I had with 2.1 was re, but is also implemented :) I think the main stumble block now (at least in my case using BioPython/NumPy/matplotlib) is mainly that some of those libraries have lots of extensions written in C :( On 12/21/06, Timothy Freund <tim@xxxxxxxxxxxxxxxxxxxxxxx> wrote: > Tiago -- > > Welcome! I thought cmath looked like a good starting point as well, so > I implemented it a few weeks ago when I was just starting out with > Jython. The patch was applied to the 2.3 branch. I was also unhappy > with the implementation of test_cmath, so I took some inspiration from > the Jakarta Commons Math project when reimplementing test_cmath.py. A > second set of eyes looking at those tests probably wouldn't be a bad idea. > > You can get a nightly build of 2.3 from here: > http://jython.achievewith.us/nightly/2.3/ > > You can check out 2.3 here: > https://svn.sourceforge.net/svnroot/jython/branches/2.3 > > Thanks, > > > Tim > > Tiago Antão wrote: > > Hi! > > > > I am a Jython user (mainly doing Bioinformatics/Population Genetics > > work with Python and Java). I am trying to understand what is the > > state of using Jython with things like SciPy, BioPython, etc... > > In that light, I have a hands on/solve problems approach. If its not > > implemented and it doesn't take the rest of my life, I will give it a > > try... > > I started with > > http://wiki.python.org/jython/JythonDeveloperGuide/PortingPythonModulesToJython > > I thought about math, as it is something needed and very simple to > > start with. I suppose the documentation is not in sync with the code, > > as math seems to be implemented in the trunk? > > > > My next target would be cmath (which seems not to be implemented). > > test_cmath.py is not on jython (but on CPython is available). In any > > case test_cmath.py is quite barebones. > > > > Does this strategy makes any sense: > > 1. get test_cmath.py into jython from cpython > > 2. make a workable cmath module for jython > > 3. improve test_cmath.py a little bit > > 4. assure that cmath works ok in jython and cpython > > 5. submit both the cmath implementation and the new test_cmath.py > > > > Does this look crazy? Or looks more or less a decent starting point? > > > > > > Many thanks, > > Tiago > > > > PS - If I find inconsistencies in the documentation (like the fact > > that math is not implemented, when it is) can I just go ahead and > > change it? What is the acceptable policy for a newbie? > > > > -- > Timothy Freund > http://digital-achievement.com > http://edodyssey.com > -- The right to offend is far more important than the right not to be offended - Rowan Atkinson ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: "Khalid Zuberi" <kzuberi@xxxxxxxxx>
In-reply-to:
<45823DC1.4000909@xxxxxxxxxxxxxxxxxxxxxxx>
References:
<590465ac0612092243v6e9dee43sd3b59eb1bf66fe87@xxxxxxxxxxxxxx> <108379910612120133s270faef7jdcbb11379327e169@xxxxxxxxxxxxxx> <96c4692d0612142152r7a5823c2j740fe65dd98e2ed7@xxxxxxxxxxxxxx> <45823DC1.4000909@xxxxxxxxxxxxxxxxxxxxxxx>
On 12/15/06, Timothy Freund <tim@xxxxxxxxxxxxxxxxxxxxxxx> wrote: > > Once the bugtests move into their version specific locations, I'll add a > step to the BuildBot to run driver.py, and I will configure failures in > regrtest.py to not flag a build as failed. > > Tim A few couple of tiny fixes have got trunk now building again against java 1.3. I hope to commit the bugtest driver changes & move in the next day or two. Did you get any volunteers for java 6 coverage? - kz ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: "Josh Juneau" <j.juneau@xxxxxxxxx>
References:
<4560A20A.8030701@xxxxxxx> <4571C37C.5000407@xxxxxxx> <ba90a0a90612211422w456bad4w56a5c61729a6b0de@xxxxxxxxxxxxxx>
Good luck Oti. That will be great news if you are able to present at JavaOne. ----- Original Message ----- From: "Oti" <ohumbel@xxxxxxxxx> To: "Charles Oliver Nutter" <charles.nutter@xxxxxxx> Cc: "jython-dev" <jython-dev@xxxxxxxxxxxxxxxxxxxxx> Sent: Thursday, December 21, 2006 4:22 PM Subject: Re: [Jython-dev] [Fwd: JavaOne Update: Call for Papers Now Open] > Hi Charles, others, > > I submitted a paper with the title "Jython and Java: Plug & Play". > My aim is to show show how well Java and Jython interact. > > Since I have no experience in submitting papers, I have no idea if it > has a chance to be accepted.. > And - second - if my company will let me go. > > best wishes, > Oti. > > On 12/2/06, Charles Oliver Nutter <charles.nutter@xxxxxxx> wrote: >> Charles Oliver Nutter wrote: >> > I don't know if y'all have seen this, but if we can all get Jython back >> > up and going there's going to be folks interested in hearing about it >> > at >> > JavaOne. It's also motivation to get done what we want to get done. >> > >> > Please try to submit at least one talk...and maybe more if any of you >> > have related talks you think would be worth presenting. I'm keen to see >> > the major dynlangs like Python and Ruby take back JavaOne. >> >> Just a reminder guys, I'd love to see some of you try to present at >> JavaOne, and I'm sure Jython will be clicking along really well by then. >> >> -- >> Charles Oliver Nutter, JRuby Core Developer >> Blogging on Ruby and Java @ headius.blogspot.com >> Help spec out Ruby today! @ www.headius.com/rubyspec >> headius@xxxxxxxxxxx -- charles.nutter@xxxxxxx >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share >> your >> opinions on IT & business topics through brief surveys - and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Jython-dev mailing list >> Jython-dev@xxxxxxxxxxxxxxxxxxxxx >> https://lists.sourceforge.net/lists/listinfo/jython-dev >> > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-dev mailing list > Jython-dev@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/jython-dev ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: Paul Drummond <Paul.Drummond@xxxxxxxxx>
> This is great to hear. Please do continue blogging because it surely helps others in the future. Thanks for your kind words - makes all the blogging feel worth while! > Btw, did you notice that your blog is mentioned at <http://wiki.python.org/moin/JythonSprint>? I did - it was a nice surprise :) > Let's hope that it gets into 2.2 or that it at least can be installed separately and used with it. Yes. Once I have something working on the 2.3 branch I will look into whether it can be back-ported to 2.2, depending on time scales of course. Cheers, Paul. This e-mail and any attachments are for the intended addressee(s) only and may contain confidential and/or privileged material. If you are not a named addressee, do not use, retain or disclose such information. This email is not guaranteed to be free from viruses and does not bind Serco in any contract or obligation. Serco Limited. Registered in England and Wales. No: 242246 Registered Office: Serco House,16 Bartley Wood Business Park, Hook, Hampshire RG27 9UY United Kingdom. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: "Pekka Laukkanen" <peke@xxxxxx>
In-reply-to:
<3A94C0FC25D123479849D308F25AD30E55072B@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References:
<3A94C0FC25D123479849D308F25AD30E55072B@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
2006/12/21, Paul Drummond <Paul.Drummond@xxxxxxxxx>: > > How is it going with the csv module porting? > > I am making good progress when I get a chance to work on it but I have very > little spare time! I have two weeks off work over xmas so hopefully I will > make some real progress then. > > As this is a learning exercise for me it may take longer to complete that it > should. I am getting side-tracked when I come across areas of Jython's > design that I am new to, and taking the time to blog about my findings also > eats up precious time. I think once I understand keyword arguments properly > [and blog about it ;) ], then some real progress can be made. The ACTUAL > CSV parsing should be relatively straight-forward - it's understanding the > Jython infrastructure that slows things down. This is great to hear. Please do continue blogging because it surely helps others in the future. Btw, did you notice that your blog is mentioned at <http://wiki.python.org/moin/JythonSprint>? > > Btw, will csv module be 2.3 dependent or is it possible to get it into > 2.2? > > Hmmm. No idea what in my code would make it 2.3 dependent but I am using > the 2.3 branch as recommended in the DevelopmentGuide. Ok. Let's hope that it gets into 2.2 or that it at least can be installed separately and used with it. Cheers, .peke ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: Timothy Freund <tim@xxxxxxxxxxxxxxxxxxxxxxx>
In-reply-to:
<f5f747f10612210748m64b8516blc3b59934ab787955@xxxxxxxxxxxxxx>
References:
<6d941f120612210215p130be96ia831d9b5d2b54948@xxxxxxxxxxxxxx> <f5f747f10612210748m64b8516blc3b59934ab787955@xxxxxxxxxxxxxx>
It's true -- the cmath module was committed by Charlie Groves into the 2.3 branch in r3006. I meant to send that info to the list this morning, but I hit reply rather than reply all. I'm not a huge cmath user, so expert eyes looking over the implementation and the improved unit tests might not hurt. Tim Pekka Laukkanen wrote: > 2006/12/21, Tiago Antão <tiagoantao@xxxxxxxxx>: >> I started with >> http://wiki.python.org/jython/JythonDeveloperGuide/PortingPythonModulesToJython >> >> >> I thought about math, as it is something needed and very simple to >> start with. I suppose the documentation is not in sync with the code, >> as math seems to be implemented in the trunk? >> >> My next target would be cmath (which seems not to be implemented). >> test_cmath.py is not on jython (but on CPython is available). In any >> case test_cmath.py is quite barebones. > > Based on the mail by Timothy Freund (added into cc separately) on > 2006-11-20 also cmath is implemented. At least he wrote the following > in a mail available through archives at > http://sourceforge.net/mailarchive/forum.php?thread_id=31079861&forum_id=5587 > > > ----------------8<-------------------------------------------------------------------- > > > I just submitted a patch containing an implementation of the cmath > module. It is issue #1600162 at http://www.jython.org/patches. > > This is my first module implementation, so I'm sure there is room for > improvement. Your comments are appreciated. > --------------------------------------------------8<---------------------------------- > > > > This is all I know about the subject so I don't have any idea what's > the status of the patch. > >> PS - If I find inconsistencies in the documentation (like the fact >> that math is not implemented, when it is) can I just go ahead and >> change it? What is the acceptable policy for a newbie? > > I assume this is one of those cases where it's better to ask for > forgiveness than permission. Especially because it's a wiki and edits > can be easily removed. > > Cheers, > .peke -- Timothy Freund http://digital-achievement.com http://edodyssey.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 22, 2006
From: Leo User <leouser126@xxxxxxxxx>
In-reply-to:
<20061221235047.65708.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
References:
<20061221235047.65708.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Yes, it is the byte code generated by a 5 + compiler.
I just compiled __builtin__ with a 6 javac and it
immediately resulted in the odd behavior occuring.
With the byte that came with jython3005 up using this:
PyFloat.class
becomes
Class.forName("org.python.core.PyFloat), which
resulted in the PyFloat having its class initialised.
This in turn lead to it being deposited in PyType.
Now with the delayed 5+ code, this no longer occurs.
leouser
--- Leo User <leouser126@xxxxxxxxx> wrote:
> Cool,
>
> Ive been playing around with variations as
> well(Oddly
> one variation seemed to cause jython to speed up in
> Mustang... which is double odd because the code in
> question wasn't being invoked...). It seems that
> things just need to be perturbed somewhat to make
> the
> problem manifest. Im not sure why this has worked
> in
> the past, I know they changed how statics are
> initialised in 5. Thing.class doesn't guarantee
> that
> the class is initialised. I hope the fix will help
> out the jikes user as well.
>
> leouser
>
> --- Samuele Pedroni <pedronis@xxxxxxxxxxxxxxxxxx>
> wrote:
>
> > Leo User wrote:
> > > The extra check that appears to work is:
> > > if(class_to_type.containsKey(c)) //New
> > > return (PyType)class_to_type.get(c); //New
> > > PyType newtype = c == PyType.class ? new
> > > PyType(true) : new PyType();
> > >
> > > class_to_type.put(c, newtype);
> > >
> > > fillFromClass(newtype, name, c, base,
> > > newstyle, setup, exposed_methods);
> > >
> > > return newtype;
> > >
> > >
> > > at the end of addFromClass.
> > >
> > >
> >
> > yes, I have checked in a variation of this with a
> > ref to the thread
> > (although sf seems slow to put mail in their list
> > archives)
> > > leouser
> > >
> > >
> > > --- Leo User <leouser126@xxxxxxxxx> wrote:
> > >
> > >
> > >> Incidentally, a possible fix is to do this:
> > >> dict.__setitem__("float",
> > >> PyFloat.FLOATTYPE);//
> > >> PyType.fromClass(PyFloat.class));
> > >>
> > >>
> > >> in classDictInit. This requires moving
> FLOATTYPE
> > >> from
> > >> private to package protected. But it does
> remove
> > >> the
> > >> double PyType/PyFloat problem and allows
> > >> isinstance(2.0, float)
> > >>
> > >> to return 1/True.
> > >>
> > >> It would be great to make fromClass immune to
> > this
> > >> interaction:
> > >> Class exposed_as =
> > >> (Class)exposed_decl_get_object(cur,
> > >> "as");
> > >>
> > >> if(exposed_as != null) {
> > >>
> > >> PyType exposed_as_type
> =
> > >> fromClass(exposed_as);
> > >>
> > >> class_to_type.put(c,
> > >> exposed_as_type);
> > >>
> > >> return exposed_as_type;
> > >>
> > >> }
> > >>
> > >>
> > >> would sticking a check to class_to_type before
> > >> fromClass is executed again solve the problem
> > with
> > >> an
> > >> 100% guarantee? It might, given that accessing
> > the
> > >> PyFloat field exposed_* is static and triggers
> > the
> > >> class initialisation. This would be cheaper
> than
> > >> going through all the classes and following the
> > >> first
> > >> fix listed at the top of the page.
> > >>
> > >> leouser
> > >>
> > >>
> > >> --- Leo User <leouser126@xxxxxxxxx> wrote:
> > >>
> > >>
> > >>> Hi,
> > >>>
> > >>> I experienced this bug:
> > >>>
> > >>>
> > >
> >
>
http://sourceforge.net/tracker/index.php?func=detail&aid=1230210&group_id=12867&atid=112867
> > >
> > >>> [ 1230210 ] isinstance(2.0, float) fails with
> > >>>
> > >> jikes
> > >>
> > >>> with javac and a modified jython. What is
> > >>>
> > >> occuring
> > >>
> > >>> is
> > >>> that in the process of producing a PyType for
> > >>> PyFloat
> > >>> a static initializer is executed, causing
> > another
> > >>> PyFloat/PyType to be created just before the
> > other
> > >>> one
> > >>> has an opportunity to be created and cached.
> > The
> > >>> problem I saw was:
> > >>> __builtin__ classDictInit creates a bunch of
> > >>>
> > >> PyType
> > >>
> > >>> instances via PyType.fromClass.
> > >>>
> > >>> But PyFloat also does this with a static
> field:
> > >>> private static final PyType FLOATTYPE =
> > >>> PyType.fromClass(PyFloat.class);
> > >>>
> > >>>
> > >>> hence the call from __builtin__ causes PyFloat
> > to
> > >>> initialized its FLOATTYPE field while it is in
> > the
> > >>> process of creating a PyType for PyFloat.
> This
> > >>> results in multiple PyTypes floating around
> for
> > >>> PyFloat. This does not appear to be a unique
> > >>> possibility for PyFloat.
> > >>>
> > >>> PyLong, PyInteger, PyString and who knows
> where
> > >>>
> > >> else
> > >>
> > >>> this pattern appears.
> > >>>
> > >>> leouser
> > >>>
> > >>>
> > __________________________________________________
> > >>> Do You Yahoo!?
> > >>> Tired of spam? Yahoo! Mail has the best spam
> > >>> protection around
> > >>> http://mail.yahoo.com
> > >>>
> > >>>
> > >>>
> > >
> >
>
-------------------------------------------------------------------------
> > >
> > >>> Take Surveys. Earn Cash. Influence the Future
> of
> > >>>
> > >> IT
> > >>
> > >>> Join SourceForge.net's Techsay panel and
> you'll
> > >>>
> > >> get
> > >>
> > >>> the chance to share your
> > >>> opinions on IT & business topics through brief
> > >>> surveys - and earn cash
> > >>>
> > >>>
> > >
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > >
>
=== message truncated ===
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Leo User <leouser126@xxxxxxxxx>
In-reply-to:
<458B1A62.8010201@xxxxxxxxxxxxxxxxxx>
References:
<458B1A62.8010201@xxxxxxxxxxxxxxxxxx>
Cool,
Ive been playing around with variations as well(Oddly
one variation seemed to cause jython to speed up in
Mustang... which is double odd because the code in
question wasn't being invoked...). It seems that
things just need to be perturbed somewhat to make the
problem manifest. Im not sure why this has worked in
the past, I know they changed how statics are
initialised in 5. Thing.class doesn't guarantee that
the class is initialised. I hope the fix will help
out the jikes user as well.
leouser
--- Samuele Pedroni <pedronis@xxxxxxxxxxxxxxxxxx>
wrote:
> Leo User wrote:
> > The extra check that appears to work is:
> > if(class_to_type.containsKey(c)) //New
> > return (PyType)class_to_type.get(c); //New
> > PyType newtype = c == PyType.class ? new
> > PyType(true) : new PyType();
> >
> > class_to_type.put(c, newtype);
> >
> > fillFromClass(newtype, name, c, base,
> > newstyle, setup, exposed_methods);
> >
> > return newtype;
> >
> >
> > at the end of addFromClass.
> >
> >
>
> yes, I have checked in a variation of this with a
> ref to the thread
> (although sf seems slow to put mail in their list
> archives)
> > leouser
> >
> >
> > --- Leo User <leouser126@xxxxxxxxx> wrote:
> >
> >
> >> Incidentally, a possible fix is to do this:
> >> dict.__setitem__("float",
> >> PyFloat.FLOATTYPE);//
> >> PyType.fromClass(PyFloat.class));
> >>
> >>
> >> in classDictInit. This requires moving FLOATTYPE
> >> from
> >> private to package protected. But it does remove
> >> the
> >> double PyType/PyFloat problem and allows
> >> isinstance(2.0, float)
> >>
> >> to return 1/True.
> >>
> >> It would be great to make fromClass immune to
> this
> >> interaction:
> >> Class exposed_as =
> >> (Class)exposed_decl_get_object(cur,
> >> "as");
> >>
> >> if(exposed_as != null) {
> >>
> >> PyType exposed_as_type =
> >> fromClass(exposed_as);
> >>
> >> class_to_type.put(c,
> >> exposed_as_type);
> >>
> >> return exposed_as_type;
> >>
> >> }
> >>
> >>
> >> would sticking a check to class_to_type before
> >> fromClass is executed again solve the problem
> with
> >> an
> >> 100% guarantee? It might, given that accessing
> the
> >> PyFloat field exposed_* is static and triggers
> the
> >> class initialisation. This would be cheaper than
> >> going through all the classes and following the
> >> first
> >> fix listed at the top of the page.
> >>
> >> leouser
> >>
> >>
> >> --- Leo User <leouser126@xxxxxxxxx> wrote:
> >>
> >>
> >>> Hi,
> >>>
> >>> I experienced this bug:
> >>>
> >>>
> >
>
http://sourceforge.net/tracker/index.php?func=detail&aid=1230210&group_id=12867&atid=112867
> >
> >>> [ 1230210 ] isinstance(2.0, float) fails with
> >>>
> >> jikes
> >>
> >>> with javac and a modified jython. What is
> >>>
> >> occuring
> >>
> >>> is
> >>> that in the process of producing a PyType for
> >>> PyFloat
> >>> a static initializer is executed, causing
> another
> >>> PyFloat/PyType to be created just before the
> other
> >>> one
> >>> has an opportunity to be created and cached.
> The
> >>> problem I saw was:
> >>> __builtin__ classDictInit creates a bunch of
> >>>
> >> PyType
> >>
> >>> instances via PyType.fromClass.
> >>>
> >>> But PyFloat also does this with a static field:
> >>> private static final PyType FLOATTYPE =
> >>> PyType.fromClass(PyFloat.class);
> >>>
> >>>
> >>> hence the call from __builtin__ causes PyFloat
> to
> >>> initialized its FLOATTYPE field while it is in
> the
> >>> process of creating a PyType for PyFloat. This
> >>> results in multiple PyTypes floating around for
> >>> PyFloat. This does not appear to be a unique
> >>> possibility for PyFloat.
> >>>
> >>> PyLong, PyInteger, PyString and who knows where
> >>>
> >> else
> >>
> >>> this pattern appears.
> >>>
> >>> leouser
> >>>
> >>>
> __________________________________________________
> >>> Do You Yahoo!?
> >>> Tired of spam? Yahoo! Mail has the best spam
> >>> protection around
> >>> http://mail.yahoo.com
> >>>
> >>>
> >>>
> >
>
-------------------------------------------------------------------------
> >
> >>> Take Surveys. Earn Cash. Influence the Future of
> >>>
> >> IT
> >>
> >>> Join SourceForge.net's Techsay panel and you'll
> >>>
> >> get
> >>
> >>> the chance to share your
> >>> opinions on IT & business topics through brief
> >>> surveys - and earn cash
> >>>
> >>>
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> >
> >>> _______________________________________________
> >>> Jython-dev mailing list
> >>> Jython-dev@xxxxxxxxxxxxxxxxxxxxx
> >>>
> >>>
> >
>
https://lists.sourceforge.net/lists/listinfo/jython-dev
> >
> >>
> __________________________________________________
> >> Do You Yahoo!?
> >> Tired of spam? Yahoo! Mail has the best spam
> >> protection around
> >> http://mail.yahoo.com
> >>
> >>
> >>
> >
>
-------------------------------------------------------------------------
> >
> >> Take Surveys. Earn Cash. Influence the Future of
> IT
> >> Join SourceForge.net's Techsay panel and you'll
> get
> >> the chance to share your
> >> opinions on IT & business topics through brief
> >> surveys - and earn cash
> >>
> >>
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> >
> >> _______________________________________________
> >> Jython-dev mailing list
> >> Jython-dev@xxxxxxxxxxxxxxxxxxxxx
>
=== message truncated ===
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Samuele Pedroni <pedronis@xxxxxxxxxxxxxxxxxx>
In-reply-to:
<968496.22129.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
References:
<968496.22129.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Leo User wrote:
> The extra check that appears to work is:
> if(class_to_type.containsKey(c)) //New
> return (PyType)class_to_type.get(c); //New
> PyType newtype = c == PyType.class ? new
> PyType(true) : new PyType();
>
> class_to_type.put(c, newtype);
>
> fillFromClass(newtype, name, c, base,
> newstyle, setup, exposed_methods);
>
> return newtype;
>
>
> at the end of addFromClass.
>
>
yes, I have checked in a variation of this with a ref to the thread
(although sf seems slow to put mail in their list
archives)
> leouser
>
>
> --- Leo User <leouser126@xxxxxxxxx> wrote:
>
>
>> Incidentally, a possible fix is to do this:
>> dict.__setitem__("float",
>> PyFloat.FLOATTYPE);//
>> PyType.fromClass(PyFloat.class));
>>
>>
>> in classDictInit. This requires moving FLOATTYPE
>> from
>> private to package protected. But it does remove
>> the
>> double PyType/PyFloat problem and allows
>> isinstance(2.0, float)
>>
>> to return 1/True.
>>
>> It would be great to make fromClass immune to this
>> interaction:
>> Class exposed_as =
>> (Class)exposed_decl_get_object(cur,
>> "as");
>>
>> if(exposed_as != null) {
>>
>> PyType exposed_as_type =
>> fromClass(exposed_as);
>>
>> class_to_type.put(c,
>> exposed_as_type);
>>
>> return exposed_as_type;
>>
>> }
>>
>>
>> would sticking a check to class_to_type before
>> fromClass is executed again solve the problem with
>> an
>> 100% guarantee? It might, given that accessing the
>> PyFloat field exposed_* is static and triggers the
>> class initialisation. This would be cheaper than
>> going through all the classes and following the
>> first
>> fix listed at the top of the page.
>>
>> leouser
>>
>>
>> --- Leo User <leouser126@xxxxxxxxx> wrote:
>>
>>
>>> Hi,
>>>
>>> I experienced this bug:
>>>
>>>
> http://sourceforge.net/tracker/index.php?func=detail&aid=1230210&group_id=12867&atid=112867
>
>>> [ 1230210 ] isinstance(2.0, float) fails with
>>>
>> jikes
>>
>>> with javac and a modified jython. What is
>>>
>> occuring
>>
>>> is
>>> that in the process of producing a PyType for
>>> PyFloat
>>> a static initializer is executed, causing another
>>> PyFloat/PyType to be created just before the other
>>> one
>>> has an opportunity to be created and cached. The
>>> problem I saw was:
>>> __builtin__ classDictInit creates a bunch of
>>>
>> PyType
>>
>>> instances via PyType.fromClass.
>>>
>>> But PyFloat also does this with a static field:
>>> private static final PyType FLOATTYPE =
>>> PyType.fromClass(PyFloat.class);
>>>
>>>
>>> hence the call from __builtin__ causes PyFloat to
>>> initialized its FLOATTYPE field while it is in the
>>> process of creating a PyType for PyFloat. This
>>> results in multiple PyTypes floating around for
>>> PyFloat. This does not appear to be a unique
>>> possibility for PyFloat.
>>>
>>> PyLong, PyInteger, PyString and who knows where
>>>
>> else
>>
>>> this pattern appears.
>>>
>>> leouser
>>>
>>> __________________________________________________
>>> Do You Yahoo!?
>>> Tired of spam? Yahoo! Mail has the best spam
>>> protection around
>>> http://mail.yahoo.com
>>>
>>>
>>>
> -------------------------------------------------------------------------
>
>>> Take Surveys. Earn Cash. Influence the Future of
>>>
>> IT
>>
>>> Join SourceForge.net's Techsay panel and you'll
>>>
>> get
>>
>>> the chance to share your
>>> opinions on IT & business topics through brief
>>> surveys - and earn cash
>>>
>>>
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
>>> _______________________________________________
>>> Jython-dev mailing list
>>> Jython-dev@xxxxxxxxxxxxxxxxxxxxx
>>>
>>>
> https://lists.sourceforge.net/lists/listinfo/jython-dev
>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam? Yahoo! Mail has the best spam
>> protection around
>> http://mail.yahoo.com
>>
>>
>>
> -------------------------------------------------------------------------
>
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get
>> the chance to share your
>> opinions on IT & business topics through brief
>> surveys - and earn cash
>>
>>
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
>> _______________________________________________
>> Jython-dev mailing list
>> Jython-dev@xxxxxxxxxxxxxxxxxxxxx
>>
>>
> https://lists.sourceforge.net/lists/listinfo/jython-dev
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Jython-dev mailing list
> Jython-dev@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/jython-dev
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Leo User <leouser126@xxxxxxxxx>
In-reply-to:
<520433.2214.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
References:
<520433.2214.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
The extra check that appears to work is:
if(class_to_type.containsKey(c)) //New
return (PyType)class_to_type.get(c); //New
PyType newtype = c == PyType.class ? new
PyType(true) : new PyType();
class_to_type.put(c, newtype);
fillFromClass(newtype, name, c, base,
newstyle, setup, exposed_methods);
return newtype;
at the end of addFromClass.
leouser
--- Leo User <leouser126@xxxxxxxxx> wrote:
> Incidentally, a possible fix is to do this:
> dict.__setitem__("float",
> PyFloat.FLOATTYPE);//
> PyType.fromClass(PyFloat.class));
>
>
> in classDictInit. This requires moving FLOATTYPE
> from
> private to package protected. But it does remove
> the
> double PyType/PyFloat problem and allows
> isinstance(2.0, float)
>
> to return 1/True.
>
> It would be great to make fromClass immune to this
> interaction:
> Class exposed_as =
> (Class)exposed_decl_get_object(cur,
> "as");
>
> if(exposed_as != null) {
>
> PyType exposed_as_type =
> fromClass(exposed_as);
>
> class_to_type.put(c,
> exposed_as_type);
>
> return exposed_as_type;
>
> }
>
>
> would sticking a check to class_to_type before
> fromClass is executed again solve the problem with
> an
> 100% guarantee? It might, given that accessing the
> PyFloat field exposed_* is static and triggers the
> class initialisation. This would be cheaper than
> going through all the classes and following the
> first
> fix listed at the top of the page.
>
> leouser
>
>
> --- Leo User <leouser126@xxxxxxxxx> wrote:
>
> > Hi,
> >
> > I experienced this bug:
> >
>
http://sourceforge.net/tracker/index.php?func=detail&aid=1230210&group_id=12867&atid=112867
> > [ 1230210 ] isinstance(2.0, float) fails with
> jikes
> >
> > with javac and a modified jython. What is
> occuring
> > is
> > that in the process of producing a PyType for
> > PyFloat
> > a static initializer is executed, causing another
> > PyFloat/PyType to be created just before the other
> > one
> > has an opportunity to be created and cached. The
> > problem I saw was:
> > __builtin__ classDictInit creates a bunch of
> PyType
> > instances via PyType.fromClass.
> >
> > But PyFloat also does this with a static field:
> > private static final PyType FLOATTYPE =
> > PyType.fromClass(PyFloat.class);
> >
> >
> > hence the call from __builtin__ causes PyFloat to
> > initialized its FLOATTYPE field while it is in the
> > process of creating a PyType for PyFloat. This
> > results in multiple PyTypes floating around for
> > PyFloat. This does not appear to be a unique
> > possibility for PyFloat.
> >
> > PyLong, PyInteger, PyString and who knows where
> else
> > this pattern appears.
> >
> > leouser
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
> >
>
-------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of
> IT
> > Join SourceForge.net's Techsay panel and you'll
> get
> > the chance to share your
> > opinions on IT & business topics through brief
> > surveys - and earn cash
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Jython-dev mailing list
> > Jython-dev@xxxxxxxxxxxxxxxxxxxxx
> >
>
https://lists.sourceforge.net/lists/listinfo/jython-dev
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get
> the chance to share your
> opinions on IT & business topics through brief
> surveys - and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Jython-dev mailing list
> Jython-dev@xxxxxxxxxxxxxxxxxxxxx
>
https://lists.sourceforge.net/lists/listinfo/jython-dev
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Leo User <leouser126@xxxxxxxxx>
In-reply-to:
<753457.75101.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
References:
<753457.75101.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Incidentally, a possible fix is to do this:
dict.__setitem__("float",
PyFloat.FLOATTYPE);//
PyType.fromClass(PyFloat.class));
in classDictInit. This requires moving FLOATTYPE from
private to package protected. But it does remove the
double PyType/PyFloat problem and allows
isinstance(2.0, float)
to return 1/True.
It would be great to make fromClass immune to this
interaction:
Class exposed_as = (Class)exposed_decl_get_object(cur,
"as");
if(exposed_as != null) {
PyType exposed_as_type =
fromClass(exposed_as);
class_to_type.put(c,
exposed_as_type);
return exposed_as_type;
}
would sticking a check to class_to_type before
fromClass is executed again solve the problem with an
100% guarantee? It might, given that accessing the
PyFloat field exposed_* is static and triggers the
class initialisation. This would be cheaper than
going through all the classes and following the first
fix listed at the top of the page.
leouser
--- Leo User <leouser126@xxxxxxxxx> wrote:
> Hi,
>
> I experienced this bug:
>
http://sourceforge.net/tracker/index.php?func=detail&aid=1230210&group_id=12867&atid=112867
> [ 1230210 ] isinstance(2.0, float) fails with jikes
>
> with javac and a modified jython. What is occuring
> is
> that in the process of producing a PyType for
> PyFloat
> a static initializer is executed, causing another
> PyFloat/PyType to be created just before the other
> one
> has an opportunity to be created and cached. The
> problem I saw was:
> __builtin__ classDictInit creates a bunch of PyType
> instances via PyType.fromClass.
>
> But PyFloat also does this with a static field:
> private static final PyType FLOATTYPE =
> PyType.fromClass(PyFloat.class);
>
>
> hence the call from __builtin__ causes PyFloat to
> initialized its FLOATTYPE field while it is in the
> process of creating a PyType for PyFloat. This
> results in multiple PyTypes floating around for
> PyFloat. This does not appear to be a unique
> possibility for PyFloat.
>
> PyLong, PyInteger, PyString and who knows where else
> this pattern appears.
>
> leouser
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get
> the chance to share your
> opinions on IT & business topics through brief
> surveys - and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Jython-dev mailing list
> Jython-dev@xxxxxxxxxxxxxxxxxxxxx
>
https://lists.sourceforge.net/lists/listinfo/jython-dev
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Leo User <leouser126@xxxxxxxxx>
Hi, I experienced this bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1230210&group_id=12867&atid=112867 [ 1230210 ] isinstance(2.0, float) fails with jikes with javac and a modified jython. What is occuring is that in the process of producing a PyType for PyFloat a static initializer is executed, causing another PyFloat/PyType to be created just before the other one has an opportunity to be created and cached. The problem I saw was: __builtin__ classDictInit creates a bunch of PyType instances via PyType.fromClass. But PyFloat also does this with a static field: private static final PyType FLOATTYPE = PyType.fromClass(PyFloat.class); hence the call from __builtin__ causes PyFloat to initialized its FLOATTYPE field while it is in the process of creating a PyType for PyFloat. This results in multiple PyTypes floating around for PyFloat. This does not appear to be a unique possibility for PyFloat. PyLong, PyInteger, PyString and who knows where else this pattern appears. leouser __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Eric Dobbs <eric@xxxxxxxxxx>
In-reply-to:
<ba90a0a90612211308m40335fd5yf7e054f94afe114@xxxxxxxxxxxxxx>
References:
<72363B92-735F-49E3-A2F7-22A493201D43@xxxxxxxxxx> <96c4692d0612142230i5fa5fa90p8c0eda15c423a910@xxxxxxxxxxxxxx> <9DC3F098-1BCF-4928-889D-9F6332F58E59@xxxxxxxxxx> <ba90a0a90612211308m40335fd5yf7e054f94afe114@xxxxxxxxxxxxxx>
On Dec 21, 2006, at 2:08 PM, Oti wrote: > thanks for the invitation ! > But I live in Europe (and we are waiting for snow, by the way :-) Has news of our little snow storm made it all the way to Europe? The driveway and sidewalk I shoveled this morning had half a meter of snow on it (20" for the yanks. :-) Happy holidays everyone. -Eric ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Oti <ohumbel@xxxxxxxxx>
In-reply-to:
<4571C37C.5000407@xxxxxxx>
References:
<4560A20A.8030701@xxxxxxx> <4571C37C.5000407@xxxxxxx>
Hi Charles, others, I submitted a paper with the title "Jython and Java: Plug & Play". My aim is to show show how well Java and Jython interact. Since I have no experience in submitting papers, I have no idea if it has a chance to be accepted.. And - second - if my company will let me go. best wishes, Oti. On 12/2/06, Charles Oliver Nutter <charles.nutter@xxxxxxx> wrote: > Charles Oliver Nutter wrote: > > I don't know if y'all have seen this, but if we can all get Jython back > > up and going there's going to be folks interested in hearing about it at > > JavaOne. It's also motivation to get done what we want to get done. > > > > Please try to submit at least one talk...and maybe more if any of you > > have related talks you think would be worth presenting. I'm keen to see > > the major dynlangs like Python and Ruby take back JavaOne. > > Just a reminder guys, I'd love to see some of you try to present at > JavaOne, and I'm sure Jython will be clicking along really well by then. > > -- > Charles Oliver Nutter, JRuby Core Developer > Blogging on Ruby and Java @ headius.blogspot.com > Help spec out Ruby today! @ www.headius.com/rubyspec > headius@xxxxxxxxxxx -- charles.nutter@xxxxxxx > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-dev mailing list > Jython-dev@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/jython-dev > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Leo User <leouser126@xxxxxxxxx>
In-reply-to:
<86879.35284.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
References:
<86879.35284.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Hmm, it appears that gutting PyStringMap so that it uses a HashMap internally also has an effect on the timings: 821 751 748 742 739 742 738 733 734 732 this assumes of course that my reimplementation of PyStringMap is correct. It appears that it may shave off another 250 milliseconds from the test. leouser --- Leo User <leouser126@xxxxxxxxx> wrote: > Hmm, it looks like some elementary changes to the > caching system can speed things up even further. > From > running my TestLoopTime.py test, Im seeing a drop of > about 300 more milliseconds from execution. > > UNMODIFIED TIMES: > 2087 > 2023 > 2015 > 2022 > 2017 > > MODIFIED TIMES: > 978 > 915 > 891 > 899 > 897 > > These were in the 1000 - 1200 range before > modifying. > Im a little surprised to see the jump. Im not sure > why its happening, is it because: > a. invokevirtual is more efficient when invoking a > method against the highest class that declares an > overriden method? > > b. The cache is that much faster(doubtful)? > > c. Fewer classes because of better cache > management(doubtful here as well)? > > leouser > > > > > > ____________________________________________________________________________________ > Any questions? Get answers on any topic at > www.Answers.yahoo.com. Try it now. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get > the chance to share your > opinions on IT & business topics through brief > surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-dev mailing list > Jython-dev@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/jython-dev > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Date: December 21, 2006
From: Oti <ohumbel@xxxxxxxxx>
In-reply-to:
<9DC3F098-1BCF-4928-889D-9F6332F58E59@xxxxxxxxxx>
References:
<72363B92-735F-49E3-A2F7-22A493201D43@xxxxxxxxxx> <96c4692d0612142230i5fa5fa90p8c0eda15c423a910@xxxxxxxxxxxxxx> <