Re: Building CPython

2015-05-15 Thread Terry Reedy
On 5/15/2015 4:59 AM, Marko Rauhamaa wrote: Must a method lookup necessarily involve object creation? Where is matters, inside loops, method lookup can be avoided after doing it once. for i in range(100): ob.meth(i) versus meth = ob.meth for i in range(100): meth(i) For working wi

Re: Building CPython

2015-05-15 Thread Chris Angelico
On Sat, May 16, 2015 at 1:00 AM, Ian Kelly wrote: > On Fri, May 15, 2015 at 6:43 AM, Steven D'Aprano > wrote: >> How much time would it save? Probably very little. After all, unless the >> method call itself did bugger-all work, the time to create the method >> object is probably insignificant. B

Re: Building CPython

2015-05-15 Thread Ian Kelly
ike it is already being done: https://hg.python.org/cpython/file/e7c7431f91b2/Objects/methodobject.c#l7 -- https://mail.python.org/mailman/listinfo/python-list

Re: Building CPython

2015-05-15 Thread Ian Kelly
On Fri, May 15, 2015 at 6:43 AM, Steven D'Aprano wrote: > How much time would it save? Probably very little. After all, unless the > method call itself did bugger-all work, the time to create the method > object is probably insignificant. But it's a possible optimization. An interesting alternati

Re: Building CPython

2015-05-15 Thread Mark Lawrence
language spec is unfixable or that the CPython implementation is unfixable? If CPython is unfixable, you can develop a better Python implementation. If Python itself is unfixable, what brings you here? Marko I forgot to mention earlier that I report all his rubbish as abuse on google groups

Re: Building CPython

2015-05-15 Thread Steven D'Aprano
ve method references. Sure. But some implementations may have a more, um, flexible approach to correctness, and offer more aggressive optimizations which break the letter of Python's semantics but work for 90% of cases. Just because CPython doesn't do so, doesn't mean that some new implem

Re: Building CPython

2015-05-15 Thread Mark Lawrence
On 15/05/2015 10:20, Marko Rauhamaa wrote: wxjmfa...@gmail.com: Implement unicode correctly. Did they reject your patch? Marko Please don't feed him, it's been obvious for years that he hasn't the faintest idea what he's talking about. -- My fellow Pythonistas, ask not what our languag

Re: Building CPython

2015-05-15 Thread Chris Angelico
On Fri, May 15, 2015 at 10:10 PM, Steven D'Aprano wrote: > The benefit of this is that most strings will use 1/2 or 1/4 of the memory > that they otherwise would need, which gives an impressive memory saving. > That leads to demonstrable speed-ups in real-world code, however it is > possible to fi

Re: Building CPython

2015-05-15 Thread Steven D'Aprano
>> >> You can not patch something that is wrong by design. > > Are you saying the Python language spec is unfixable or that the CPython > implementation is unfixable? JMF is obsessed with a trivial and artificial performance regression in the handling of Unicode strings since Py

Re: Building CPython

2015-05-15 Thread Marko Rauhamaa
Python language spec is unfixable or that the CPython implementation is unfixable? If CPython is unfixable, you can develop a better Python implementation. If Python itself is unfixable, what brings you here? Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Building CPython

2015-05-15 Thread Christian Gollwitzer
Am 14.05.15 um 20:50 schrieb Terry Reedy: On 5/14/2015 1:11 PM, Chris Angelico wrote: 2) make test - run the entire test suite. Takes just as long every time, but most of it won't have changed. The test runner has an option, -jn, to run tests in n processes instead of just 1. On my 6 core pe

Re: Building CPython

2015-05-15 Thread Marko Rauhamaa
Chris Angelico : > On Fri, May 15, 2015 at 6:59 PM, Marko Rauhamaa wrote: >> Must a method lookup necessarily involve object creation? > > Actually, no. > [...] > a particular Python implementation is most welcome to notice the > extremely common situation of method calls and optimize it. I'm no

Re: Building CPython

2015-05-15 Thread Chris Angelico
On Fri, May 15, 2015 at 8:14 PM, Steven D'Aprano wrote: > (If anything, using an implicit boolean test will be faster than an > explicit manual test, because it doesn't have to call the len() global.) Even more so: Some objects may be capable of determining their own lengths, but can ascertain th

Re: Building CPython

2015-05-15 Thread Steven D'Aprano
On Fri, 15 May 2015 06:59 pm, Marko Rauhamaa wrote: > However, in some respects, Python might be going overboard with its > dynamism; are all those dunder methods really needed? Must "false" be > defined so broadly? Must a method lookup necessarily involve object > creation? Yes, what do you mean

Re: Building CPython

2015-05-15 Thread Chris Angelico
this work even if the "foo.bar" part is broken out: def return_function(): return foo.bar def call_function(): return_function()(1, 2, 3) But a particular Python implementation is most welcome to notice the extremely common situation of method calls and optimize it. I'm

Re: Building CPython

2015-05-15 Thread BartC
mplemention would be simpler, and possibly faster. But then the language wouldn't be Python any more. That's the challenge; programs must still work as they did before. (But I suppose it can be exasperating for CPython developers if 99% of programs could be made faster but can't

Re: Building CPython

2015-05-15 Thread Marko Rauhamaa
wxjmfa...@gmail.com: > Implement unicode correctly. Did they reject your patch? Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Building CPython

2015-05-15 Thread Marko Rauhamaa
Gregory Ewing : > BartC wrote: >> It appears to be those "<=" and "+" operations in the code above >> where much of the time is spent. When I trace out the execution paths >> a bit more, I'll have a better picture of how many lines of C code >> are involved in each iteration. > > The path from dec

Re: Building CPython

2015-05-14 Thread Gregory Ewing
BartC wrote: It appears to be those "<=" and "+" operations in the code above where much of the time is spent. When I trace out the execution paths a bit more, I'll have a better picture of how many lines of C code are involved in each iteration. The path from decoding a bytecode to the C cod

Re: Building CPython

2015-05-14 Thread BartC
On 14/05/2015 22:55, BartC wrote: > def whiletest(): > i=0 > while i<=1: > i=i+1 > > whiletest() > Python 2.5 9.2 seconds Python 3.1 13.1 Python 3.4.317.0 Python 3.4.314.3 (under Ubuntu on same machine, using the version I buil

Re: Building CPython

2015-05-14 Thread MRAB
On 2015-05-14 22:55, BartC wrote: On 14/05/2015 17:29, Marko Rauhamaa wrote: BartC : That's a shame because I wanted to tinker with the main dispatcher loop to try and find out what exactly is making it slow. Nothing that seems obvious at first sight. My guess is the main culprit is attribut

Re: Building CPython

2015-05-14 Thread BartC
On 14/05/2015 17:29, Marko Rauhamaa wrote: BartC : That's a shame because I wanted to tinker with the main dispatcher loop to try and find out what exactly is making it slow. Nothing that seems obvious at first sight. My guess is the main culprit is attribute lookup in two ways: * Each obj

Re: Building CPython

2015-05-14 Thread Terry Reedy
On 5/14/2015 1:11 PM, Chris Angelico wrote: 2) make test - run the entire test suite. Takes just as long every time, but most of it won't have changed. The test runner has an option, -jn, to run tests in n processes instead of just 1. On my 6 core pentium, -j5 cuts time to almost exactly 1/5

Re: Building CPython

2015-05-14 Thread Chris Angelico
On Fri, May 15, 2015 at 3:32 AM, BartC wrote: > OK, thanks. I didn't even know where the executable was put! Now I don't > need 'make install', while 'make test' I won't bother with any more. > > Making a small change and typing 'make' took 5 seconds, which is reasonable > enough (although I had t

Re: Building CPython

2015-05-14 Thread BartC
On 14/05/2015 18:11, Chris Angelico wrote: On Fri, May 15, 2015 at 3:02 AM, BartC wrote: I hope there's a quicker way of re-building an executable after a minor source file change, otherwise doing any sort of development is going to be impractical.) The whole point of 'make' is to rebuild o

Re: Building CPython

2015-05-14 Thread Chris Angelico
On Fri, May 15, 2015 at 3:02 AM, BartC wrote: > Actually I had VirtualBox with Ubuntu, but I don't know my way around Linux > and preferred doing things under Windows (and with all my own tools). > > But it's now building under Ubuntu. > > (Well, I'm not sure what it's doing exactly; the instructi

Re: Building CPython

2015-05-14 Thread Dave Angel
On 05/14/2015 01:02 PM, BartC wrote: On 14/05/2015 17:09, Chris Angelico wrote: On Fri, May 15, 2015 at 1:51 AM, BartC wrote: OK, the answer seems to be No then - you can't just trivially compile the C modules that comprise the sources with the nearest compiler to hand. So much for C's famous

Re: Building CPython

2015-05-14 Thread BartC
On 14/05/2015 17:09, Chris Angelico wrote: On Fri, May 15, 2015 at 1:51 AM, BartC wrote: OK, the answer seems to be No then - you can't just trivially compile the C modules that comprise the sources with the nearest compiler to hand. So much for C's famous portability! (Actually, I think you a

Re: Building CPython

2015-05-14 Thread Marko Rauhamaa
BartC : > That's a shame because I wanted to tinker with the main dispatcher > loop to try and find out what exactly is making it slow. Nothing that > seems obvious at first sight. My guess is the main culprit is attribute lookup in two ways: * Each object attribute reference involves a diction

Re: Building CPython

2015-05-14 Thread Chris Angelico
tform to platform, plus a (relatively) tiny section of platform-specific code, such as makefiles/project files, linker definitions, and so on. When you start hacking on CPython, you don't generally have to consider which platform you're aiming at, as long as you're building on one of the

Re: Building CPython

2015-05-14 Thread BartC
On 13/05/2015 23:34, Terry Reedy wrote: On 5/13/2015 3:36 PM, BartC wrote: I'm interested in playing with the CPython sources. I need to be able to build under Windows, but don't want to use make files (which rarely work properly), nor do a 6GB installation of Visual Studio Expres

Re: Building CPython

2015-05-13 Thread Terry Reedy
On 5/13/2015 3:36 PM, BartC wrote: I'm interested in playing with the CPython sources. I need to be able to build under Windows, but don't want to use make files (which rarely work properly), nor do a 6GB installation of Visual Studio Express which is what seems to be needed (I'

Re: Building CPython

2015-05-13 Thread Mark Lawrence
On 13/05/2015 20:36, BartC wrote: I'm interested in playing with the CPython sources. I need to be able to build under Windows, but don't want to use make files (which rarely work properly), nor do a 6GB installation of Visual Studio Express which is what seems to be needed (I'

Building CPython

2015-05-13 Thread BartC
I'm interested in playing with the CPython sources. I need to be able to build under Windows, but don't want to use make files (which rarely work properly), nor do a 6GB installation of Visual Studio Express which is what seems to be needed (I'm hopeless with complicated IDEs a

JDBC support in a CPython ORM? - Maybe via the JayDeBeApi package?

2015-02-11 Thread Alec Taylor
Attempting to connect to Hadoop-based SQL layers, which are [practically] all written in JVM languages. Sure, I can use something like JayDeBeApi, but I would prefer proper object mapping. How would I go about interfacing with e.g.: SQL Alchemy or peewee-orm? Thanks for all suggestions -- htt

Re: jitpy - Library to embed PyPy into CPython

2014-12-09 Thread Christopher
x27;t currently work under pypy. With this tool I could still take advantage of pypy JIT, but use CPython for other stuff. --- SoupGate-Win32 v1.05 * Origin: nntp.gatew...@.piz.noip.me> (1:249/999) --- Synchronet 3.15b-Win32 NewsLink 1.92 SpaceSST BBS Usenet <> Fidonet Gateway -- https:/

Re: jitpy - Library to embed PyPy into CPython

2014-12-09 Thread Joshua Landau
To: python-list On 7 December 2014 at 14:31, Albert-Jan Roskam wrote: > On Sun, Dec 7, 2014 11:06 AM CET Stefan Behnel wrote: >> >>I think this is trying to position PyPy more in the same corner as other >>JIT compilers for CPython, as opposed to keeping it a completely s

Re: jitpy - Library to embed PyPy into CPython

2014-12-08 Thread Christopher
currently work under pypy. With this tool I could still take advantage of pypy JIT, but use CPython for other stuff. -- https://mail.python.org/mailman/listinfo/python-list

Re: jitpy - Library to embed PyPy into CPython

2014-12-08 Thread Joshua Landau
On 7 December 2014 at 14:31, Albert-Jan Roskam wrote: > On Sun, Dec 7, 2014 11:06 AM CET Stefan Behnel wrote: >> >>I think this is trying to position PyPy more in the same corner as other >>JIT compilers for CPython, as opposed to keeping it a completely separate >>thi

Re: jitpy - Library to embed PyPy into CPython

2014-12-07 Thread Albert-Jan Roskam
s://github.com/fijal/jitpy >> >> Interesting, but it is not clear to me when you would use jitpy instead >> of pypy. > >I think this is trying to position PyPy more in the same corner as other >JIT compilers for CPython, as opposed to keeping it a completely separate >t

Re: jitpy - Library to embed PyPy into CPython

2014-12-07 Thread Stefan Behnel
itpy instead > of pypy. I think this is trying to position PyPy more in the same corner as other JIT compilers for CPython, as opposed to keeping it a completely separate thing which suffers from being "not CPython". It's a huge dependency, but so are others. Being able to cho

Re: jitpy - Library to embed PyPy into CPython

2014-12-06 Thread Sturla Molden
Albert-Jan Roskam wrote: > Interesting, but it is not clear to me when you would use jitpy instead > of pypy. Too bad pypy alone was not included in the benchmarks (cython > would have also been nice). And Numba can JIT compile this far better than PyPy and jitpy. Sturla -- https://mail.pytho

Re: jitpy - Library to embed PyPy into CPython

2014-12-06 Thread Albert-Jan Roskam
On Fri, Dec 5, 2014 8:54 PM CET Mark Lawrence wrote: >For those who haven't heard thought this might be of interest >https://github.com/fijal/jitpy Interesting, but it is not clear to me when you would use jitpy instead of pypy. Too bad pypy alone was not included

Re: jitpy - Library to embed PyPy into CPython

2014-12-05 Thread Terry Reedy
On 12/5/2014 2:54 PM, Mark Lawrence wrote: For those who haven't heard thought this might be of interest https://github.com/fijal/jitpy So the old cpython module psyco which became the pypy jit is back as jitpy. Nice. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/p

jitpy - Library to embed PyPy into CPython

2014-12-05 Thread Mark Lawrence
For those who haven't heard thought this might be of interest https://github.com/fijal/jitpy -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Clearing globals in CPython

2014-10-06 Thread Chris Angelico
On Mon, Oct 6, 2014 at 8:08 PM, Steven D'Aprano wrote: > On Mon, 06 Oct 2014 09:05:17 +, jakubo wrote: > >> After invoking autocompletion (.__ and hitting tab), session has been >> automagically healed. > > > That's ... um ... > > I have no words. > > > Can you confirm that autocompletion modi

Re: Clearing globals in CPython

2014-10-06 Thread Steven D'Aprano
On Mon, 06 Oct 2014 09:05:17 +, jakubo wrote: > After invoking autocompletion (.__ and hitting tab), session has been > automagically healed. That's ... um ... I have no words. Can you confirm that autocompletion modifies globals()? I don't have 3.4 installed here. -- Steven -- https

Re: Clearing globals in CPython

2014-10-06 Thread jakubo
On 2014-10-01, Peter Otten <__pete...@web.de> wrote: > Steven D'Aprano wrote: > >> Out of curiosity, I ran: >> >> globals().clear() >> >> Oops. >> >> So, with no built-ins available, import no longer works. That makes things >> rather tricky. >> >> Obviously the easiest way to recover is to exi

Re: Clearing globals in CPython

2014-10-02 Thread Stefan Behnel
Chris Angelico schrieb am 02.10.2014 um 16:12: > On Fri, Oct 3, 2014 at 12:07 AM, Grant Edwards wrote: >> On 2014-10-01, Steven D'Aprano wrote: >> >>> Obviously the easiest way to recover is to exit the current session and >>> restart it, but as a challenge, can we recover from this state? >> >> Py

Re: Clearing globals in CPython

2014-10-02 Thread Chris Angelico
On Fri, Oct 3, 2014 at 12:07 AM, Grant Edwards wrote: > On 2014-10-01, Steven D'Aprano wrote: > >> Obviously the easiest way to recover is to exit the current session and >> restart it, but as a challenge, can we recover from this state? > > Python apparently _does_ need a "restart command". App

Re: Clearing globals in CPython

2014-10-02 Thread Grant Edwards
On 2014-10-01, Steven D'Aprano wrote: > Obviously the easiest way to recover is to exit the current session and > restart it, but as a challenge, can we recover from this state? Python apparently _does_ need a "restart command". -- Grant Edwards grant.b.edwardsYow! The PI

Re: Clearing globals in CPython

2014-10-02 Thread Marco Buttu
On 01/10/2014 18:00, Steven D'Aprano wrote: Out of curiosity, I ran: globals().clear() in the interactive interpreter. It broke much more than I expected! Built-ins were no longer available, and import stopped working. Interesting... :D Obviously the easiest way to recover is to exit the c

Re: Clearing globals in CPython

2014-10-02 Thread Mark Lawrence
On 02/10/2014 09:11, Steven D'Aprano wrote: Peter Otten wrote: Steven D'Aprano wrote: Obviously the easiest way to recover is to exit the current session and restart it, but as a challenge, can we recover from this state? $ python3 Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2]

Re: Clearing globals in CPython

2014-10-02 Thread Steven D'Aprano
Peter Otten wrote: > Steven D'Aprano wrote: >> Obviously the easiest way to recover is to exit the current session and >> restart it, but as a challenge, can we recover from this state? > > $ python3 > Python 3.4.0 (default, Apr 11 2014, 13:05:11) > [GCC 4.8.2] on linux > Type "help", "copyright

Re: Clearing globals in CPython

2014-10-01 Thread Terry Reedy
yntax machine with no name bindings -- sort of like a high-level assembler with no access to a function library. I expected that global variables would be all lost, but built-ins would remain, since they don't live in the global namespace. ... The reason, I think, is that CPython has a special __

Re: Clearing globals in CPython

2014-10-01 Thread Mark Lawrence
would remain, since they don't live in the global namespace. I was wrong: globals().clear() x = len([]) Traceback (most recent call last): File "", line 1, in NameError: name 'len' is not defined The reason, I think, is that CPython has a special __builtins__ global

Re: Clearing globals in CPython

2014-10-01 Thread Peter Otten
but built-ins would > remain, since they don't live in the global namespace. I was wrong: > >>>> globals().clear() >>>> x = len([]) > Traceback (most recent call last): > File "", line 1, in > NameError: name 'len' is not define

Re: Clearing globals in CPython

2014-10-01 Thread Chris Kaynor
On Wed, Oct 1, 2014 at 9:14 AM, Chris Angelico wrote: > On Thu, Oct 2, 2014 at 2:00 AM, Steven D'Aprano > wrote: > > Obviously the easiest way to recover is to exit the current session and > > restart it, but as a challenge, can we recover from this state? > > Oooh interesting. This is kinda lik

Re: Clearing globals in CPython

2014-10-01 Thread Chris Angelico
On Thu, Oct 2, 2014 at 2:00 AM, Steven D'Aprano wrote: > Obviously the easiest way to recover is to exit the current session and > restart it, but as a challenge, can we recover from this state? Oooh interesting. This is kinda like breaking out of a sandbox, and I know there are people here who a

Clearing globals in CPython

2014-10-01 Thread Steven D'Aprano
lobal namespace. I was wrong: >>> globals().clear() >>> x = len([]) Traceback (most recent call last): File "", line 1, in NameError: name 'len' is not defined The reason, I think, is that CPython has a special __builtins__ global variable that the interpre

Re: [OT?]cpython pull from hg

2014-09-06 Thread Terry Reedy
On 9/6/2014 4:42 AM, Peter Otten wrote: Mark Lawrence wrote: The following doesn't make any sense to me as I've very limited knowledge of Mercurial so can someone explain why it says "added 12 changesets with 26 changes to 22 files" but then "3 files updated, 0 files merged, 0 files removed, 0

Re: [OT?]cpython pull from hg

2014-09-06 Thread Peter Otten
, 0 files unresolved". I'd expect to see > 22 files updated. The output is cut and pasted directly from the > TortoiseHg Sync screen. I'm no expert either, but I would guess that the other modified files exist only in another branch. > % hg pull --verbose --update --

[OT?]cpython pull from hg

2014-09-06 Thread Mark Lawrence
pect to see 22 files updated. The output is cut and pasted directly from the TortoiseHg Sync screen. % hg pull --verbose --update --config ui.merge=internal:merge http://hg.python.org/cpython pulling from http://hg.python.org/cpython searching for changes all local heads known remotely adding

Re: Test failure while building cpython

2014-08-20 Thread Terry Reedy
On 8/20/2014 8:24 PM, Adam Bishop wrote: >> Or you can ignore it. > > It's a little tricky with mock, as failures during the test phase are fatal. Unfortunately, I have no idea what 'mock' is in this context. Thanks for pointing me in the right direction. If you possibly can, also act on N

Re: Test failure while building cpython

2014-08-20 Thread Adam Bishop
been built with different CFLAGS than cpython proper. > Or you can ignore it. It's a little tricky with mock, as failures during the test phase are fatal. There's probably a config option to suppress that though. > I am guessing that CentOS does not guarantee that Red Hat source c

Re: Test failure while building cpython

2014-08-20 Thread Ned Deily
In article <09843563-b0fd-451b-bf66-0fb720cec...@ja.net>, Adam Bishop wrote: > I'm trying to build python 3.3.2 from source packages provided by Red Hat > under mock. > > The build itself works,but one specific test is failing: > >=

Re: Test failure while building cpython

2014-08-20 Thread Terry Reedy
On 8/20/2014 7:05 PM, Adam Bishop wrote: I'm trying to build python 3.3.2 from source packages provided by Red Hat under mock. The build itself works,but one specific test is failing: == FAIL: test_sysconfig_module (d

Test failure while building cpython

2014-08-20 Thread Adam Bishop
use it to fail? I don't see how the CFLAGS used in the build process could change during the test run. Other details: CentOS 7 x86_64, GCC 4.8.2, Python 3.3.2, mock 1.1.41 [1] https://github.com/python/cpython/blob/edc966f9c5bc9291d2b7009f600e243142cf8a22/Lib/distutils/tests/test_sysconfig.p

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Laxmikant Chitare
ttp://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ >>> >> montanaro.html >> >>> >>> Just wanted to clarify whether CPython already includes these kind of >>> byte code optimizations? >>> >> > Most of the easily seen and

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Terry Reedy
On 2/17/2014 3:59 AM, Steven D'Aprano wrote: On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html Just wanted to clarify whether CPython already includes these ki

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Ned Batchelder
On 2/17/14 3:59 AM, Steven D'Aprano wrote: On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html Just wanted to clarify whether CPython already includes these kind of

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Steven D'Aprano
On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: > I read about this article: > http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html > > Just wanted to clarify whether CPython already includes these kind of > byte code optimizatio

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Peter Otten
Laxmikant Chitare wrote: > Hello All, > > I read about this article: > http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/montanaro.html > > Just wanted to clarify whether CPython already includes these kind of byte > code optimizations? Are all th

Does CPython already has Peephole optimizations?

2014-02-17 Thread Laxmikant Chitare
Hello All, I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/montanaro.html Just wanted to clarify whether CPython already includes these kind of byte code optimizations? Are all the temporary variables removed when byte code is generated? Regards

Re: Why is CPython 2.5 a dependency for Jython 2.5?

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 10:55 PM, rusi wrote: > On Wednesday, July 3, 2013 5:52:12 PM UTC+5:30, Steven D'Aprano wrote: >> I'm running a box with Debian squeeze, and I just ran: >> sudo aptitude install jython >> which ended up installing Python 2.5: > > BTW trying to install jython out here gave me

Re: Why is CPython 2.5 a dependency for Jython 2.5?

2013-07-03 Thread rusi
On Wednesday, July 3, 2013 5:52:12 PM UTC+5:30, Steven D'Aprano wrote: > I'm running a box with Debian squeeze, and I just ran: > sudo aptitude install jython > which ended up installing Python 2.5: BTW trying to install jython out here gave me this list (which does not seem to have this dependenc

Re: Why is CPython 2.5 a dependency for Jython 2.5?

2013-07-03 Thread Steven D'Aprano
On Wed, 03 Jul 2013 07:43:46 -0500, Skip Montanaro wrote: >> Does anyone know why CPython 2.5 is a dependency for Jython 2.5.1+ on >> Debian squeeze? > > Might Jython use some Python modules/packages unmodified? Does sys.path > in Jython refer to the CPython tree? Apparent

Re: Why is CPython 2.5 a dependency for Jython 2.5?

2013-07-03 Thread Skip Montanaro
> Does anyone know why CPython 2.5 is a dependency for Jython 2.5.1+ on > Debian squeeze? Might Jython use some Python modules/packages unmodified? Does sys.path in Jython refer to the CPython tree? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is CPython 2.5 a dependency for Jython 2.5?

2013-07-03 Thread rusi
On Wednesday, July 3, 2013 5:52:12 PM UTC+5:30, Steven D'Aprano wrote: > Does anyone know why CPython 2.5 is a dependency for Jython 2.5.1+ on > Debian squeeze? Not exactly answering your question... The debian dependencies can be fairly 'conservative' which means all kind

Why is CPython 2.5 a dependency for Jython 2.5?

2013-07-03 Thread Steven D'Aprano
I'm running a box with Debian squeeze, and I just ran: sudo aptitude install jython which ended up installing Python 2.5: [...] Linking and byte-compiling packages for runtime python2.5... Setting up python2.5 (2.5.5-11) ... Does anyone know why CPython 2.5 is a dependency for Jython

Re: Timsort in Cpython

2013-06-19 Thread Ian Kelly
s, if they were supplied. > But how do these PyObject* look in C? It's a pointer to a struct that contains information like the class and reference count of the object. > How does a PyListObject* look declared in CPython. That's a pointer to a larger struct that shares

Re: Timsort in Cpython

2013-06-19 Thread sean . westfall
; > > > > listsort(PyListObject *self, PyObject *args, PyObject *kwds) > > > > > > I've never worked with Cpython source before, but it looks like PyObject is > > just some type of general strut.. I think anyway. How does python represent > > a list of ints i

Re: Timsort in Cpython

2013-06-19 Thread sean . westfall
thon's implementation of timsort through cpython: > >http://hg.python.org/cpython/file/default/Objects/listobject.c > > > > > Since you are new to GoogleGroups, if you can, run away from it as fast > > as possible. While material may look okay on their sys

Re: Timsort in Cpython

2013-06-16 Thread Ian Kelly
h by > all means, I'm not lazy, I can figure it myself. But, I wanted to pass in > variables into listsort and watch timsort work line by line in gdb. > > listsort(PyListObject *self, PyObject *args, PyObject *kwds) > > I've never worked with Cpython source before, but i

Re: Timsort in Cpython

2013-06-16 Thread alphonse23
sorry about that. I'm new to google groups. I'm trying to make sense of python's implementation of timsort through cpython: http://hg.python.org/cpython/file/default/Objects/listobject.c I was replying to Terry Jan Reedy > > http://hg.python.org/cpython/file/default/Objects

Re: Timsort in Cpython

2013-06-16 Thread mm0fmf
ver worked with Cpython source before, but it looks like PyObject is just some type of general strut.. I think anyway. How does python represent a list of ints in source? and what are the two second arguments for, assuming the first is the list strut. On Saturday, June 15, 2013 12:44:01

Re: Timsort in Cpython

2013-06-15 Thread alphonse23
, I wanted to pass in variables into listsort and watch timsort work line by line in gdb. listsort(PyListObject *self, PyObject *args, PyObject *kwds) I've never worked with Cpython source before, but it looks like PyObject is just some type of general strut.. I think anyway. How does pyt

Re: Timsort in Cpython

2013-06-15 Thread Terry Reedy
On 6/15/2013 4:21 PM, alphons...@gmail.com wrote: Well. I'm going to have a ton of fun trying to make sense of this. http://hg.python.org/cpython/file/default/Objects/listsort.txt is pretty clear (to me) for most of the basics. -- Terry Jan Reedy -- http://mail.python.org/mailman/lis

Re: Timsort in Cpython

2013-06-15 Thread alphonse23
or the C implementation of builtin types' methods > in > > the Python codebase. The C implementation listsort() corresponds with the > Python > > method list.sort(). Similarly, listappend() is list.append(), listpop() is > > list.pop(), etc. C.f. > >

Re: Timsort in Cpython

2013-06-15 Thread Robert Kern
(), etc. C.f. http://hg.python.org/cpython/file/default/Objects/listobject.c#l2362 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth.&q

Re: Timsort in Cpython

2013-06-15 Thread alphonse23
Hey guys, Thanks for the quick reply! So why did they decide to call it listsort in the source instead? Why didn't they keep it as Timsort? Well. I'm going to have a ton of fun trying to make sense of this. -- http://mail.python.org/mailman/listinfo/python-list

Re: Timsort in Cpython

2013-06-15 Thread Robert Kern
On 2013-06-15 20:44, alphons...@gmail.com wrote: I'm currently trying to make sense of Python's Timsort function. From the wikipedia page I was told the algorithm is located somewhere here: http://hg.python.org/cpython/file/default/Objects/listobject.c So of all the functions in th

Re: Timsort in Cpython

2013-06-15 Thread Zachary Ware
On Sat, Jun 15, 2013 at 2:44 PM, wrote: > I'm currently trying to make sense of Python's Timsort function. From the > wikipedia page I was told the algorithm is located somewhere here: > http://hg.python.org/cpython/file/default/Objects/listobject.c > > So of all the

Timsort in Cpython

2013-06-15 Thread alphonse23
I'm currently trying to make sense of Python's Timsort function. From the wikipedia page I was told the algorithm is located somewhere here: http://hg.python.org/cpython/file/default/Objects/listobject.c So of all the functions in there, could somebody point to me which one is timsor

Re: Is python.org powered by CPython?

2013-05-24 Thread Ned Deily
In article , Carlos Nepomuceno wrote: > Is python.org powered by CPython? Like many websites, the python.org domain consists of a number of subdomains with several different webservers on various hosts. AFAIK, the main www.python.org server is currently all (or mainly) static content ser

Is python.org powered by CPython?

2013-05-24 Thread Carlos Nepomuceno
Is python.org powered by CPython? Is it using WSGI? What Python version is been used? I already checked it's using Apache. Is it using mod_wsgi? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: A new webpage promoting Compiler technology for CPython

2013-02-17 Thread Thomas Heller
Am 15.02.2013 08:11, schrieb Travis Oliphant: Hey all, With Numba and Blaze we have been doing a lot of work on what essentially is compiler technology and realizing more and more that we are treading on ground that has been plowed before with many other projects. So, we wanted to create a web

Re: __class__ and type() implementation details in CPython

2013-02-10 Thread Steven D'Aprano
Ivan Yurchenko wrote: > Hello. > > I've done the following in CPython 2.7.3 and 3.3.0 (and also in PyPy > 2.0b1): > >>>> import weakref >>>> x = set() >>>> y = weakref.proxy(x) >>>> x.__class__, type(x), isinstance(x, set) &g

__class__ and type() implementation details in CPython

2013-02-10 Thread Ivan Yurchenko
Hello. I've done the following in CPython 2.7.3 and 3.3.0 (and also in PyPy 2.0b1): >>> import weakref >>> x = set() >>> y = weakref.proxy(x) >>> x.__class__, type(x), isinstance(x, set) (, , True) >>> y.__class__, type(y), isinstance(y, set) (

Re: Good debugger for CPython 3.2?

2012-10-19 Thread Dan Stromberg
On Fri, Oct 19, 2012 at 9:26 AM, Dan Stromberg wrote: > > What's a good debugger for CPython 3.2? I'd prefer to use it on Linux > Mint 13, and I'd be happy with something based on X11 or curses. > > I tried winpdb, but it was cranky that Linux didn't have a

<    1   2   3   4   5   6   7   >