<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://planet-soc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Planet SoC - </title>
 <link>http://planet-soc.com/organization/Python+Software+Foundation/planet</link>
 <description>Planet view per organization</description>
 <language>en</language>
<item>
 <title>Carcode GSOC</title>
 <link>http://planet-soc.com/node/3647</link>
 <description>&lt;p&gt;I haven&amp;#8217;t posted anything since Alpha 1 and currently we have Alpha 2 available, Beta 1 is around the corner (has been for quite a while).Google Summer of Code has ended, most features from my proposal where fulfilled, but I&amp;#8217;m still working on it on my free time, altough now with school I don&amp;#8217;t have as much time as in summer vacations but is free time anyways.I have updated the screenshots section from the carcode project page with latest work (beta 1):&lt;a href=&quot;http://code.google.com/p/carcode/wiki/Screenshots&quot;&gt;http://code.google.com/p/carcode/wiki/Screenshots&lt;/a&gt;Currently I&amp;#8217;m working on adding a few levels in order to have a Beta with something to work on, more levels will come and ofcourse, you can make suggestions, there is a wikipage on level design:&lt;a href=&quot;http://code.google.com/p/carcode/wiki/LevelDesign&quot;&gt;http://code.google.com/p/carcode/wiki/LevelDesign&lt;/a&gt;Feel free to add and modify!Last but not so last, I&amp;#8217;m Alive! and working on carcode! don&amp;#8217;t worry :)&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3647#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/181">Planet SoC</category>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Thu, 28 Aug 2008 02:02:00 +0200</pubDate>
 <dc:creator>clsdaniel</dc:creator>
 <guid isPermaLink="false">3647 at http://planet-soc.com</guid>
</item>
<item>
 <title>pyttk 0.2 released - August 25, 2008</title>
 <link>http://planet-soc.com/node/3632</link>
 <description>&lt;p&gt;pyttk 0.2 has been released today. As before, you can pick its source at &lt;a href=&quot;http://pypi.python.org/pypi/pyttk&quot; title=&quot;http://pypi.python.org/pypi/pyttk&quot;&gt;http://pypi.python.org/pypi/pyttk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Besides bug fixes and some improvements in its usage, it finally brings a test suite! This is also the first release after GSoC finished.&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3632#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Mon, 25 Aug 2008 23:17:20 +0200</pubDate>
 <dc:creator>gpolo</dc:creator>
 <guid isPermaLink="false">3632 at http://planet-soc.com</guid>
</item>
<item>
 <title>Last week - August 11, 2008</title>
 <link>http://planet-soc.com/node/3454</link>
 <description>&lt;p&gt;Hello again,&lt;/p&gt;

&lt;p&gt;Today I&amp;#8217;ve marked the project as complete, even though I haven&amp;#8217;t touched its code since last wednesday (probably). The remaining goal was related to IDLE, for which I had a big patch that was sent to its maillist last monday and got no complaints (and no other feedback either) yet, and I&amp;#8217;ve been using it here with all these changes without apparent problems. So, as I see, this GSoC project can be marked as complete now.&lt;/p&gt;

&lt;p&gt;I hope to write more news here in the future, although it won&amp;#8217;t be weekly news, and those will probably be related to updates in the ttk wrapper (changes caused by Tk 8.6, etc). Also, I promise you the news will have better titles/subtitles than the current ones.&lt;/p&gt;

&lt;p&gt;Finally, thanks everyone :)&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3454#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Mon, 11 Aug 2008 23:39:37 +0200</pubDate>
 <dc:creator>gpolo</dc:creator>
 <guid isPermaLink="false">3454 at http://planet-soc.com</guid>
</item>
<item>
 <title>Wrapping it up</title>
 <link>http://planet-soc.com/node/3381</link>
 <description>&lt;p&gt;The final deadline of GSoC is approaching quickly. Fortunately, I&amp;#8217;m almost finished with my project; the main part of the code was pushed in a few days ago, and in the coming days I only expect to fix bugs and write documentation.&lt;/p&gt;

&lt;p&gt;Here are some examples of things that should now work with the hg version of SymPy:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Numerical differentiation and summation of generic infinite series is also on its way. The following works with my local copy:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;&amp;gt;&amp;gt; Sum(1/n-log(1+1/n), (n, 1, oo)).evalf(50)&lt;br /&gt;0.57721566490153286060651209008240243104215933593992&amp;gt;&amp;gt; Derivative(-gamma(x), x).evalf(50, subs={x:1})&lt;br /&gt;0.57721566490153286060651209008240243104215933593992&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;
The series is summed using the Euler-Maclaurin formula; in fact, the high-order derivatives are computed symbolically behind the scenes. (Because of the need for high-order derivatives, the Euler-Maclaurin formula makes much more sense in the context of a CAS than purely numerically.) This algorithm does have its drawbacks, so at some points pure extrapolation methods (which are already used for slowly convergent hypergeometric series) will be supported as well.&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;The use of an adaptive algorithm for evalf turns out to be especially useful for numerical differentiation, as one can just directly use a finite difference formula with a tiny step size, without worrying about cancellation error.&lt;/p&gt;

&lt;p&gt;There is a lot more to be said about the details, but I&amp;#8217;m leaving that for the to-be-written documentation.&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3381#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/181">Planet SoC</category>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Thu, 07 Aug 2008 15:34:00 +0200</pubDate>
 <dc:creator>fredrikj</dc:creator>
 <guid isPermaLink="false">3381 at http://planet-soc.com</guid>
</item>
<item>
 <title>PyPy 2.5-features - Starting to port the standard lib</title>
 <link>http://planet-soc.com/node/3367</link>
 <description>&lt;p&gt;A little late I know.&lt;br /&gt;
This week I finished to fix all the failing tests and to implement PEP 328 (Absolute/Relative import).&lt;br /&gt;
Now it&amp;#8217;s the final step for supporting Python2.5 on PyPy, to port the standard library.&lt;br /&gt;
I&amp;#8217;m starting with it today and I really hope I can finish it all (including tests and everything else) until the end of next week.&lt;br /&gt;
Well, one more time, if anyone want to help me, test your python programs (specially the ones that use python2.5 specific features, like with statement, conditional expressions and new generator stuff) in PyPy-2.5-features (&lt;code&gt;svn co &lt;a href=&quot;http://codespeak.net/svn/pypy/2.5-features&quot; title=&quot;http://codespeak.net/svn/pypy/2.5-features&quot;&gt;http://codespeak.net/svn/pypy/2.5-features&lt;/a&gt; pypy-2.5-features&lt;/code&gt;).&lt;br /&gt;
How to test? Simple:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
$ cd pypy-2.5-features&lt;br /&gt;
$ ./bin/py.py your_python_program.py&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Be careful and patient, it may take a little bit to things start happening &lt;img src=&quot;http://blog.brunogola.com.br/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; /&gt;&lt;br /&gt;
Of course you can translate PyPy using the translator if you want. Take a look at PyPy&amp;#8217;s website for more information.&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3367#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/181">Planet SoC</category>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Wed, 06 Aug 2008 19:23:02 +0200</pubDate>
 <dc:creator>brunogola</dc:creator>
 <guid isPermaLink="false">3367 at http://planet-soc.com</guid>
</item>
<item>
 <title>Week 15 - August 03, 2008</title>
 <link>http://planet-soc.com/node/3282</link>
 <description>&lt;p&gt;Hey there,&lt;/p&gt;

&lt;p&gt;Now this was a good week, yes. Everything I wanted to do regarding IDLE is done now, and except for the obvious bugs, and probably others that I will find, the GSoC project is complete. A screenshot can be found at &lt;a href=&quot;http://code.google.com/p/python-ttk/wiki/Screenshots&quot; title=&quot;http://code.google.com/p/python-ttk/wiki/Screenshots&quot;&gt;http://code.google.com/p/python-ttk/wiki/Screenshots&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But.. while the week was great, I have to face the fact that the ttk wrapper won&amp;#8217;t go into Python 2.6/3.0 since, I guess, it wasn&amp;#8217;t considered important enough to be reviewed and accepted (the issue is still sitting alone at &lt;a href=&quot;http://bugs.python.org/issue2983&quot; title=&quot;http://bugs.python.org/issue2983&quot;&gt;http://bugs.python.org/issue2983&lt;/a&gt;). So the ttk wrapper can be download at &lt;a href=&quot;http://pypi.python.org/pypi/pyttk&quot; title=&quot;http://pypi.python.org/pypi/pyttk&quot;&gt;http://pypi.python.org/pypi/pyttk&lt;/a&gt; now.&lt;/p&gt;

&lt;p&gt;That was it, good luck for everyone in their (suggested) last GSoC 2008 week.&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3282#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Sun, 03 Aug 2008 19:18:16 +0200</pubDate>
 <dc:creator>gpolo</dc:creator>
 <guid isPermaLink="false">3282 at http://planet-soc.com</guid>
</item>
<item>
 <title>Google Code Jam - Round 1</title>
 <link>http://planet-soc.com/node/3234</link>
 <description>&lt;p&gt;Just to update my blog, let&amp;#8217;s get ready to GCJ Round 2 &lt;img src=&quot;http://blog.brunogola.com.br/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; /&gt;&lt;br /&gt;
Saturday 4pm UTC (it&amp;#8217;s 1pm here in Brazil, right?!)!&lt;br /&gt;
Coming Soon: GSoC Status Update (I promise!!!) &lt;img src=&quot;http://blog.brunogola.com.br/wp-includes/images/smilies/icon_razz.gif&quot; alt=&quot;:P&quot; class=&quot;wp-smiley&quot; /&gt;&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3234#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/181">Planet SoC</category>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Wed, 30 Jul 2008 16:53:40 +0200</pubDate>
 <dc:creator>brunogola</dc:creator>
 <guid isPermaLink="false">3234 at http://planet-soc.com</guid>
</item>
<item>
 <title>Division: the sequel (with bonus material)</title>
 <link>http://planet-soc.com/node/3181</link>
 <description>&lt;p&gt;I have neglected to write a GSoC update for two weeks (where &amp;#8220;two&amp;#8221; was computed using round-to-floor), so let me first apologize for that.&lt;/p&gt;

&lt;p&gt;In my &lt;a href=&quot;http://fredrik-j.blogspot.com/2008/07/making-division-in-python-faster.html&quot;&gt;last post&lt;/a&gt;, I wrote about how Newton&amp;#8217;s method (coupled with a fast multiplication algorithm, such as Karatsuba multiplication) can be used for asymptotically fast division of long integers. I have now fixed up the code to compute a correctly rounded quotient. In fact, it now performs the full divmod operation, returning both the quotient and a correct remainder.&lt;/p&gt;

&lt;p&gt;The trick is to perform an extra exact multiplication at the end to determine the remainder. By definition, the quotient r of p/q is correct if the remainder m = p - r&amp;middot;q satisfies 0 &amp;le; m &amp;lt; q. If this inequality does not hold, one need only perform an additional divmod operation (which can be performed using standard long division, since the error will almost certainly fit in a single limb) to correct both the quotient and the remainder.&lt;/p&gt;

&lt;p&gt;The extra multiplication causes some slowdown, but it&amp;#8217;s not too bad. The new idivmod function still breaks even with the builtin divmod somewhere around 1000-2000 digits and is 10 times faster at half a million digits (i.e. when dividing a million digit number by a half-million digit number):&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;&lt;br /&gt;&amp;gt;&amp;gt; time&lt;em&gt;division(int, 2.0, 20)&lt;br /&gt;      size     old time     new time       faster  correct&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;        16     0.000008     0.000052     0.155080     True&lt;br /&gt;        32     0.000005     0.000052     0.102151     True&lt;br /&gt;        64     0.000008     0.000059     0.132075     True&lt;br /&gt;       128     0.000013     0.000070     0.190476     True&lt;br /&gt;       256     0.000035     0.000107     0.325521     True&lt;br /&gt;       512     0.000126     0.000215     0.583658     True&lt;br /&gt;      1024     0.000431     0.000532     0.810399     True&lt;br /&gt;      2048     0.001855     0.001552     1.195104     True&lt;br /&gt;      4096     0.007154     0.005050     1.416708     True&lt;br /&gt;      8192     0.028505     0.015449     1.845033     True&lt;br /&gt;     16384     0.111193     0.046938     2.368925     True&lt;br /&gt;     32768     0.443435     0.142551     3.110706     True&lt;br /&gt;     65536     1.778292     0.432412     4.112497     True&lt;br /&gt;    131072     7.110184     1.305771     5.445200     True&lt;br /&gt;    262144    28.596926     3.919399     7.296253     True&lt;br /&gt;    524288   116.069764    11.804032     9.833061     True&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;
As a bonus, a fast divmod also provides a fast way to convert long integers to decimal strings, by recursively splitting n in half using L, R = divmod(n, 10b/2) where b is the number of digits in n:&lt;/p&gt;
&lt;pre&gt;&amp;gt;&amp;gt; time&lt;/em&gt;str(int, 20)&lt;br /&gt;      size     old time     new time       faster  correct&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;        16     0.000005     0.000013     0.413043     True&lt;br /&gt;        32     0.000006     0.000009     0.588235     True&lt;br /&gt;        64     0.000008     0.000012     0.674419     True&lt;br /&gt;       128     0.000020     0.000023     0.865854     True&lt;br /&gt;       256     0.000059     0.000133     0.442105     True&lt;br /&gt;       512     0.000204     0.000333     0.613255     True&lt;br /&gt;      1024     0.000895     0.001194     0.749708     True&lt;br /&gt;      2048     0.003505     0.002252     1.556824     True&lt;br /&gt;      4096     0.013645     0.006600     2.067429     True&lt;br /&gt;      8192     0.052386     0.018334     2.857358     True&lt;br /&gt;     16384     0.209164     0.052233     4.004412     True&lt;br /&gt;     32768     0.834201     0.153238     5.443827     True&lt;br /&gt;     65536     3.339629     0.450897     7.406639     True&lt;br /&gt;    131072    13.372223     1.339044     9.986392     True&lt;br /&gt;    262144    53.547894     3.998352    13.392491     True&lt;br /&gt;    524288   214.847486    11.966933    17.953429     True&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;
So printing an integer with half a million digits takes 12 seconds instead of 3.5 minutes. This can be quite a usability improvement.&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;The code can be found in this file: &lt;a href=&quot;http://www.dd.chalmers.se/~frejohl/code/div.py&quot;&gt;div.py&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have now submitted &lt;a href=&quot;http://bugs.python.org/issue3451&quot;&gt;a request&lt;/a&gt; for these algorithms to be implemented in the Python core. Since the pure Python implementation is very simple, I don&amp;#8217;t think porting it to C would be all that difficult. By &amp;#8220;request&amp;#8221;, I mean that I might eventually do it myself, but there are many others who are much more familiar with both the Python codebase and the C language, and if any of those persons happens to have a few free hours, they could certainly do it both faster and better. If you are interested in helping out with this, please post to the issue tracker.&lt;/p&gt;

&lt;p&gt;The division code is just one of several small projects I&amp;#8217;ve been working on lately. Basically, I&amp;#8217;ve found that there are some arithmetic functions that are needed very frequently in all kinds of mathematical code. These include:&lt;/p&gt;

&lt;ul&gt; 
&lt;li&gt;Pure convenience functions like sign, product, &amp;#8230;&lt;/li&gt;
&lt;p&gt; 
&lt;li&gt;Bit counting&lt;/li&gt;
&lt;p&gt; 
&lt;li&gt;Radix conversion&lt;/li&gt;
&lt;p&gt; 
&lt;li&gt;Integer square roots&lt;/li&gt;
&lt;p&gt; 
&lt;li&gt;Rational (and complex rational) arithmetic&lt;/li&gt;
&lt;p&gt; 
&lt;li&gt;Integer factorization, multiplicity tests, gcd, etc&lt;/li&gt;
&lt;p&gt; 
&lt;li&gt;Factorials, binomial coefficients, etc&lt;/li&gt;
&lt;p&gt;&lt;/ul&gt;

&lt;p&gt;Such utility functions are currently scattered throughout &lt;a href=&quot;http://code.google.com/p/mpmath/&quot;&gt;mpmath&lt;/a&gt;, &lt;a href=&quot;http://code.google.com/p/sympy/&quot;&gt;SymPy&lt;/a&gt; and &lt;a href=&quot;http://code.google.com/p/sympycore/&quot;&gt;SympyCore&lt;/a&gt; codebases. Many of them are hack-ish, duplicates, and/or don&amp;#8217;t always work/have very poor worst-case performance. Right now, I&amp;#8217;m trying to collect them into a single module and optimizing / &lt;a href=&quot;http://en.wikipedia.org/wiki/Work_hardening&quot;&gt;strain-hardening&lt;/a&gt; them.&lt;/p&gt;

&lt;p&gt;The current result of this effort can be found &lt;a href=&quot;http://www.dd.chalmers.se/~frejohl/code/libarith/&quot;&gt;here&lt;/a&gt; (be aware that it&amp;#8217;s very much a work in progress). Among other things, it includes the mentioned fast division code, fast square root code based on my implementation from mpmath, much needed improvements to the nth root and integer factorization code I wrote for SymPy, plus the extremely fast multinomial coefficient code optimized by &lt;a href=&quot;http://cens.ioc.ee/~pearu/&quot;&gt;Pearu&lt;/a&gt; and myself for SympyCore (which, if I correctly recall the results of previous benchmarking, makes polynomial powering in SympyCore faster than &lt;a href=&quot;http://www.singular.uni-kl.de/&quot;&gt;Singular&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;My plan is to split this off to a standalone project, as it could be useful to other people as such, but keeping it a single, self-contained .py file that is easy to include in mpmath and SymPy. There won&amp;#8217;t be too much feature creep (hopefully); the advanced number theory functions in SymPy won&amp;#8217;t move, nor will the floating-point functions from mpmath.&lt;/p&gt;

&lt;p&gt;Finally, I have done a bit more work on the adaptive numerical evaluation code for SymPy. The main new features are support for converting approximate zeros to exact zeros (thereby preventing the algorithm from hanging when it encounters a nonsimplified zero expression, and overall prettifying output), and support for logarithms and powers/exponentials of complex numbers. See &lt;a href=&quot;http://www.dd.chalmers.se/~frejohl/code/evalf.py&quot;&gt;evalf.py&lt;/a&gt; and &lt;a href=&quot;http://www.dd.chalmers.se/~frejohl/code/test_evalf.py&quot;&gt;test_evalf.py&lt;/a&gt;. I&amp;#8217;ve also done miscellaneous other work on SymPy, such as patching the existing evalf code to use mpmath and getting rid of the global precision.&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3181#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <category domain="http://planet-soc.com/taxonomy/term/182">Universe SoC</category>
 <pubDate>Mon, 28 Jul 2008 00:13:00 +0200</pubDate>
 <dc:creator>fredrikj</dc:creator>
 <guid isPermaLink="false">3181 at http://planet-soc.com</guid>
</item>
<item>
 <title>Week 13 - July 20, 2008</title>
 <link>http://planet-soc.com/node/3031</link>
 <description>&lt;p&gt;So I used this week to read some of the IDLE&amp;#8217;s code and started adding support for tabs. While I have added a notebook, it barely works with all the functionality provided by IDLE, and, introduced several bugs at the same time. This week was also useful for me in the sense that now I know I underestimated the time necessary for adding this feature, but I believe it can be done in GSoC time and it is very likely I will be working on this till the end of GSoC, given the other parts of the project are done (or almost done).&lt;/p&gt;

&lt;p&gt;Lastly, if you happen to be interested in getting this feature into IDLE you may want to help me testing my custom idlelib, or something like that, so I can get some more motivation :)&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/3031#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Sun, 20 Jul 2008 23:14:22 +0200</pubDate>
 <dc:creator>gpolo</dc:creator>
 <guid isPermaLink="false">3031 at http://planet-soc.com</guid>
</item>
<item>
 <title>PyPy 2.5-features - Yet another status update</title>
 <link>http://planet-soc.com/node/2992</link>
 <description>&lt;p&gt;Here comes another GSoC status update &lt;img src=&quot;http://blog.brunogola.com.br/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; /&gt;&lt;br /&gt;
Some finished tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;throw() method on generators&lt;/li&gt;
&lt;li&gt;close() method&amp;#8230;&lt;/li&gt;
&lt;li&gt;faking 2.5 behavior for IMPORT_NAME and IMPORT_FROM opcodes&lt;/li&gt;
&lt;li&gt;changing the default value for &lt;em&gt;magic &lt;/em&gt; attribute of PyCode objects&lt;/li&gt;
&lt;li&gt;changing the magic number that goes in .pyc files compiled by PyPy&lt;/li&gt;
&lt;li&gt;fixing tests and more tests&amp;#8230;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From those changes the only one I would like to comment is the change of both magic numbers.&lt;br /&gt;
First, they have different values and meanings in PyPy. The magic number for .pyc files (defined in &lt;em&gt;pypy/modules/__builtin__/importing.py&lt;/em&gt;) is the number that identifies the bytecode &amp;#8220;version&amp;#8221;. It&amp;#8217;s used to know if the interpreter should use the .pyc file or should recompile the .py. PyPy&amp;#8217;s value is different from CPython&amp;#8217;s one. As we are changing some opcodes (as IMPORT_NAME, mentioned before) this number had to be changed. The old value in PyPy was 1024 (or 1024 + 2 or 1024 + 4 or 1024 + 2 + 4, depending on some command line options), the new value is 1034 (or &amp;#8230;.). We are just using the same policy CPython uses to change the value, add 10 to the old value.&lt;br /&gt;
Now the PyCode &lt;em&gt;magic&lt;/em&gt; attribute. This value is the CPython magic number (the one explained above)., the old default value was the value from CPython 2.4 (62021). Some checks against this value are made through the code to decide if the bytecode should be interpreted one way or another. One example is the IMPORT_NAME opcode. In Python 2.4 IMPORT_NAME did not have the level parameter, this parameter is new in 2.5 because of the &lt;em&gt;absolute import&lt;/em&gt; feature. So if the bytecode represented by a PyCode object is 2.4, when we visit a &lt;em&gt;import&lt;/em&gt; statement we should not try to pop the level value from the stack (because it&amp;#8217;s not there), but if it is 2.5 we should! So we check the magic value. The problem is, the default value was 2.4 but we changed the opcodes to behave like 2.5, so those checks were not working. The solution was to change the magic default value to 63231 (2.5c2 value I think), so now our bytecode interpreter is (almost?) compatible with 2.5 bytecode. And our compiler is generating 2.5 compatible bytecode as well.&lt;/p&gt;
</description>
 <comments>http://planet-soc.com/node/2992#comments</comments>
 <category domain="http://planet-soc.com/taxonomy/term/181">Planet SoC</category>
 <category domain="http://planet-soc.com/taxonomy/term/118">Python Software Foundation</category>
 <pubDate>Fri, 18 Jul 2008 05:27:29 +0200</pubDate>
 <dc:creator>brunogola</dc:creator>
 <guid isPermaLink="false">2992 at http://planet-soc.com</guid>
</item>
</channel>
</rss>
