Re: [Python-Dev] ElementTree.tostring() returning str by default in Py3.2

2010-03-02 Thread Stefan Behnel
Stefan Behnel, 02.03.2010 10:06: I just noticed that the xml.etree.ElementTree.tostring() function in Py3.2 returns a str object by default, unless an encoding is specified. This is a backwards incompatible change compared to ET 1.2. For one, it breaks tons of tests in lxml's compatibility

Re: [Python-Dev] [RELEASED] Python 3.1.2 release candidate

2010-03-07 Thread Stefan Behnel
Benjamin Peterson, 06.03.2010 23:13: A list of changes in 3.1.2rc1 can be found here: http://svn.python.org/projects/python/tags/r312rc1/Misc/NEWS Any reason the fix for bug 7173 didn't make it in? The test case that Amaury came up with seems to indicate that this a pretty serious issue

Re: [Python-Dev] [Python-checkins] r79397 - in python/trunk: Doc/c-api/capsule.rst Doc/c-api/cobject.rst Doc/c-api/concrete.rst Doc/data/refcounts.dat Doc/extending/extending.rst Include/Python.h Incl

2010-03-25 Thread Stefan Behnel
M.-A. Lemburg, 25.03.2010 10:10: larry.hastings wrote: Author: larry.hastings Date: Thu Mar 25 01:54:54 2010 New Revision: 79397 Log: Backported PyCapsule from 3.1, and converted most uses of CObject to PyCapsule. Backporting PyCapsule is fine, but the changes you made to all those PyCObject

Re: [Python-Dev] [Python-checkins] r79397 - in python/trunk: Doc/c-api/capsule.rst Doc/c-api/cobject.rst Doc/c-api/concrete.rst Doc/data/refcounts.dat Doc/extending/extending.rst Include/Python.h Incl

2010-03-26 Thread Stefan Behnel
M.-A. Lemburg, 26.03.2010 10:20: Larry Hastings wrote: 3. Because CObject is unsafe, I want to deprecate it in 2.7, and if we ever made a 2.8 I want to remove it completely. Please remember that PyCObjects are not only used internally in CPython, but also in other 3rd party modules to expose C

Re: [Python-Dev] Very Strange Argument Handling Behavior

2010-04-16 Thread Stefan Behnel
Guido van Rossum, 16.04.2010 16:33: I am fine with declaring dict({}, **{1:3}) illegal, since after all it is abuse of the ** mechanism. It's a bit like letting keys like 'not-an-identifier' pass through, though, isn't it? Stefan ___ Python-Dev ma

Re: [Python-Dev] Fixing the GIL (with a BFS scheduler)

2010-05-18 Thread Stefan Behnel
Bill Janssen, 17.05.2010 23:09: Most folks don't use "threads" Seems like a somewhat reasonable assumption to me. they use a higher-level abstraction like the nltk library. I have my doubts that this applies to "most folks" - likely not even to most of those who use threads. Stefan ___

Re: [Python-Dev] Are PyCFunctions supposed to invisibly consume self when used as a method?

2010-06-16 Thread Stefan Behnel
Christian Heimes, 13.06.2010 01:22: Am 13.06.2010 01:15, schrieb Guido van Rossum: Hey! No borrowing the time machine! :-) Too late Get the irony? Stefan ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/py

Re: [Python-Dev] thoughts on the bytes/string discussion

2010-06-26 Thread Stefan Behnel
Ian Bicking, 26.06.2010 00:26: On Fri, Jun 25, 2010 at 4:02 PM, Guido van Rossum wrote: On Fri, Jun 25, 2010 at 1:43 PM, Glyph Lefkowitz I'd like a version of 'decode' which would give me a type that was, in every respect, unicode, and responded to all protocols exactly as other unicode objec

Re: [Python-Dev] thoughts on the bytes/string discussion

2010-06-26 Thread Stefan Behnel
Greg Ewing, 26.06.2010 09:58: Tres Seaver wrote: I do know for a fact that using a UCS2-compiled Python instead of the system's UCS4-compiled Python leads to measurable, noticable drop in memory consumption of long-running webserver processes using Unicode Would there be any sanity in having

Re: [Python-Dev] Can Python implementations reject semantically invalid expressions?

2010-07-01 Thread Stefan Behnel
Glyph Lefkowitz, 02.07.2010 06:43: On Jul 2, 2010, at 12:28 AM, Steven D'Aprano wrote: This question was inspired by something asked on #python today. Consider it a hypothetical, not a serious proposal. We know that many semantic errors in Python lead to runtime errors, e.g. 1 + "1". If an imp

Re: [Python-Dev] Can Python implementations reject semantically invalid expressions?

2010-07-02 Thread Stefan Behnel
Steven D'Aprano, 03.07.2010 06:35: On Sat, 3 Jul 2010 11:39:07 am Greg Ewing wrote: Stefan Behnel wrote: So, would it still be Python if it folded 1 + "1" into raise TypeError() at compile time? It would have to be raise TypeError("Exactly the message

[Python-Dev] set/dict comprehensions don't leak in Py2.7 - intentional?

2010-07-05 Thread Stefan Behnel
Hi, I only noticed now that set/dict comprehensions were backported to 2.7 without letting the loop Variables leak into the surrounding scope. So they now behave different from list comprehensions. Is this intentional or just a backporting oversight? I'm asking because we had a discussion ab

Re: [Python-Dev] thoughts on the bytes/string discussion

2010-07-06 Thread Stefan Behnel
Ronald Oussoren, 06.07.2010 16:51: On 27 Jun, 2010, at 11:48, Greg Ewing wrote: Stefan Behnel wrote: Greg Ewing, 26.06.2010 09:58: Would there be any sanity in having an option to compile Python with UTF-8 as the internal string representation? It would break Py_UNICODE, because the

Re: [Python-Dev] Python Language Summit EuroPython 2010

2010-07-22 Thread Stefan Behnel
Maciej Fijalkowski, 22.07.2010 10:43: On Thu, Jul 22, 2010 at 9:51 AM, Brett Cannon wrote: Basically the whole setting a module's globals to None was done before gc came into the language. Now that it's there it seems that it might work to simply let gc clean up the module itself. But this bring

Re: [Python-Dev] module shutdown procedure

2010-07-22 Thread Stefan Behnel
Georg Brandl, 22.07.2010 16:13: Am 22.07.2010 13:29, schrieb Antoine Pitrou: Le jeudi 22 juillet 2010 à 07:23 -0500, Benjamin Peterson a écrit : 2010/7/22 Antoine Pitrou: Brett Cannon wrote: Basically the whole setting a module's globals to None was done before gc came into the language. Now

[Python-Dev] Inline caching for method calls

2010-07-22 Thread Stefan Behnel
Hi, Stefan Brunthaler started a thread on python-dev about a couple of patches he has written for CPython as part of his PhD. It seems that he has implemented inline caching for CPython. http://comments.gmane.org/gmane.comp.python.devel/115362 http://en.wikipedia.org/wiki/Inline_caching Som

[Python-Dev] Sorry, wrong list, please ignore - Re: Inline caching for method calls

2010-07-22 Thread Stefan Behnel
Sorry, this should have gone to cython-dev, not python-dev ... ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.co

Re: [Python-Dev] Python 3 optimizations...

2010-07-22 Thread Stefan Behnel
Hi, stefan brunthaler, 22.07.2010 13:22: during the last year, I have developed a couple of quickening-based optimizations for the Python 3.1 interpreter. As part of my PhD programme, I have published a first technique that combines quickening with inline caching at this year's ECOOP, and subseq

Re: [Python-Dev] Python 3 optimizations...

2010-07-23 Thread Stefan Behnel
stefan brunthaler, 23.07.2010 08:48: I guess it would be a good idea to quickly outline my inline caching approach, so that we all have a basic understanding of how it works. Yes, that certainly makes it easier to discuss. If we take for instance the BINARY_ADD instruction, the interpreter e

Re: [Python-Dev] Thoughts fresh after EuroPython

2010-07-24 Thread Stefan Behnel
Nick Coghlan, 25.07.2010 08:29: We knew PEP 380 would be hurt by the moratorium when the moratorium PEP went through. The goals of the moratorium itself, in making it possible to have a 3.2 release that is fully supported by all of the major Python implementations, still apply, and I believe mak

Re: [Python-Dev] Thoughts fresh after EuroPython

2010-07-26 Thread Stefan Behnel
geremy condra, 26.07.2010 16:29: I've noticed that I don't have a lot of success in shifting this kind of debate, so I'm not sure it's a good idea to publicly discuss vulnerabilities in something that may wind up being implemented as-is, but it's up to you guys. Hmm, security by obscurity? That

Re: [Python-Dev] New regex module for 3.2?

2010-07-26 Thread Stefan Behnel
Gregory P. Smith, 27.07.2010 07:40: A max cache size of 100 was too small. I just increased it to 500 in the py3k branch along with implementing a random replacement cache overflow policy. It now randomly drops 20% of the compiled regular expression cache instead of simply dropping the entire c

[Python-Dev] caching in the stdlib? (was: New regex module for 3.2?)

2010-07-27 Thread Stefan Behnel
R. David Murray, 28.07.2010 03:43: On Tue, 27 Jul 2010 08:27:35 +0200, Stefan Behnel wrote: Gregory P. Smith, 27.07.2010 07:40: A max cache size of 100 was too small. I just increased it to 500 in the py3k branch along with implementing a random replacement cache overflow policy. It now

Re: [Python-Dev] caching in the stdlib?

2010-07-28 Thread Stefan Behnel
I think this is better suited for python-ideas, so moving it there. Guido van Rossum, 28.07.2010 16:31: On Tue, Jul 27, 2010 at 10:29 PM, Stefan Behnel wrote: What about actually putting it visibly into the stdlib? Except for files, I didn't see much about caching there, which seems l

Re: [Python-Dev] Buffer protocol for io.BytesIO?

2010-09-03 Thread Stefan Behnel
Antoine Pitrou, 02.09.2010 22:35: In issue #5506, I originally proposed that io.BytesIO objects support the buffer protocol, to make it possible to access the internal buffer without intermediate copies. Then it came to me then perhaps it would be too automatic. So I'm currently floating between

Re: [Python-Dev] Buffer protocol for io.BytesIO?

2010-09-03 Thread Stefan Behnel
Antoine Pitrou, 03.09.2010 12:56: On Fri, 3 Sep 2010 20:44:01 +1000 Nick Coghlan wrote: It actually strikes me as a fairly bad thing, so I think you're right to distrust it. +1 It could not be resized, but it could be modified (same as what happens with bytearrays today). Actually, the buf

[Python-Dev] new LRU cache API in Py3.2

2010-09-04 Thread Stefan Behnel
Hi, reading the description of the new LRU cache in the "What's new in 3.2" document now, I got the impression that the hits/misses attributes and the .clear() method aren't really well namespaced. When I read get_phone_number.clear() it's not very obvious to me what happens, unless I kn

[Python-Dev] SVN rev. 85392 broke module handling in py3k

2010-10-22 Thread Stefan Behnel
Hi, since SVN rev. 85392, Cython's installation fails on the py3k branch with a weird globals error. I think it is related to some sys.modules magic that we do in order to support running Cython in Python 3 using lib2to3. Basically, what we do is, we import some parts of Cython at the beginni

Re: [Python-Dev] SVN rev. 85392 broke module handling in py3k

2010-10-22 Thread Stefan Behnel
Benjamin Peterson, 22.10.2010 16:03: 2010/10/22 Stefan Behnel: since SVN rev. 85392, Cython's installation fails on the py3k branch with a weird globals error. I think it is related to some sys.modules magic that we do in order to support running Cython in Python 3 using lib2to3. Basi

Re: [Python-Dev] SVN rev. 85392 broke module handling in py3k

2010-10-22 Thread Stefan Behnel
Benjamin Peterson, 22.10.2010 16:17: 2010/10/22 Stefan Behnel: Benjamin Peterson, 22.10.2010 16:03: 2010/10/22 Stefan Behnel: since SVN rev. 85392, Cython's installation fails on the py3k branch with a weird globals error. I think it is related to some sys.modules magic that we do in

Re: [Python-Dev] SVN rev. 85392 broke module handling in py3k

2010-10-22 Thread Stefan Behnel
exar...@twistedmatrix.com, 22.10.2010 16:32: Instances of classes don't refer to the module their class is defined in. It seems more likely that the reason the module is garbage collected is that there really is nothing which refers to it anymore. The behavior of setting the attributes of a modu

Re: [Python-Dev] SVN rev. 85392 broke module handling in py3k

2010-10-22 Thread Stefan Behnel
Antoine Pitrou, 22.10.2010 16:55: On Fri, 22 Oct 2010 09:41:09 -0500 Benjamin Peterson wrote: 2010/10/22 exarkun: Instances of classes don't refer to the module their class is defined in. It seems more likely that the reason the module is garbage collected is that there really is nothing whic

Re: [Python-Dev] new buffer in python2.7

2010-11-01 Thread Stefan Behnel
Kristján Valur Jónsson, 27.10.2010 16:32: Sorry, here the tables properly formatted: Certainly looked better on your first try. Stefan ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] new buffer in python2.7

2010-11-01 Thread Stefan Behnel
Kristján Valur Jónsson, 27.10.2010 16:28: Notice how a Slice object is generated. Then a PyObject_GetItem() is done. The salient code path is from apply_slice(). A slice object must be constructed and destroyed. If slice object creation bothers you here, it might be worth using a free list

Re: [Python-Dev] new buffer in python2.7

2010-11-01 Thread Stefan Behnel
Stefan Behnel, 01.11.2010 09:45: If slice object creation bothers you here, it might be worth using a free list in PySlice_New() instead of creating new slice objects on request. [...] You can take a look at how it's done in tupleoject.c if you want to provide a patch. Hmm, that's

Re: [Python-Dev] PEP 384 accepted

2010-12-04 Thread Stefan Behnel
"Martin v. Löwis", 02.12.2010 21:24: Since discussion has trailed off without any blocking objections, I'm accepting PEP 384. Martin, you may mark the PEP accepted and proceed with merging the implementation for the beta on Saturday. Thanks! will do (I'll also take into consideration the propos

[Python-Dev] nonlocal x = value

2010-12-16 Thread Stefan Behnel
Hi, it seems that Py3 doesn't support setting a "nonlocal" value as part of the "nonlocal" command Python 3.2a4+ (py3k:86480, Nov 16 2010, 16:43:22) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def x(): ... y = 5 ...

Re: [Python-Dev] nonlocal x = value

2010-12-25 Thread Stefan Behnel
Hrvoje Niksic, 24.12.2010 09:45: On 12/23/2010 10:03 PM, Laurens Van Houtven wrote: On Thu, Dec 23, 2010 at 9:51 PM, Georg Brandl wrote: Yes and no -- there may not be an ambiguity to the parser, but still to the human. Except if you disallow the syntax in any case, requiring people to write n

Re: [Python-Dev] [Python-checkins] r87504 - in python/branches/py3k: Doc/c-api/exceptions.rst Include/pyerrors.h Include/warnings.h

2010-12-28 Thread Stefan Behnel
"Martin v. Löwis", 28.12.2010 11:40: Le lundi 27 décembre 2010 à 23:07 -0500, R. David Murray a écrit : ASCII-encoded string, or ASCII encoding-string? [...] apparently, you would put the hyphen after if it's "encoding", and before if it's "encoded"; not sure why that is I think David just

Re: [Python-Dev] Omit Py_buffer struct from Stable ABI for Python 3.2?

2011-01-05 Thread Stefan Behnel
Mark Dickinson, 05.01.2011 13:55: On Wed, Jan 5, 2011 at 12:31 PM, Nick Coghlan wrote: Currently [1], the implementation and the documentation for PEP 3118's Py_buffer struct don't line up (there's an extra field in the implementation that the PEP doesn't mention). I think there are actually t

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-27 Thread Stefan Behnel
"Martin v. Löwis", 24.01.2011 21:17: The Py_UNICODE type is still supported but deprecated. It is always defined as a typedef for wchar_t, so the wstr representation can double as Py_UNICODE representation. It's too bad this isn't initialised by default, though. Py_UNICODE is the only represen

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-27 Thread Stefan Behnel
James Y Knight, 27.01.2011 21:26: On Jan 27, 2011, at 2:06 PM, Stefan Behnel wrote: "Martin v. Löwis", 24.01.2011 21:17: The Py_UNICODE type is still supported but deprecated. It is always defined as a typedef for wchar_t, so the wstr representation can double as Py_UNICODE repr

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-27 Thread Stefan Behnel
"Martin v. Löwis", 24.01.2011 21:17: If the string is created directly with the canonical representation (see below), this representation doesn't take a separate memory block, but is allocated right after the PyUnicodeObject struct. Does this mean it's supposed to become a PyVarObject? Antoine

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-27 Thread Stefan Behnel
"Martin v. Löwis", 28.01.2011 01:02: Am 27.01.2011 23:53, schrieb Stefan Behnel: "Martin v. Löwis", 24.01.2011 21:17: If the string is created directly with the canonical representation (see below), this representation doesn't take a separate memory block, but is

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-28 Thread Stefan Behnel
Florian Weimer, 28.01.2011 10:35: * Stefan Behnel: "Martin v. Löwis", 24.01.2011 21:17: The Py_UNICODE type is still supported but deprecated. It is always defined as a typedef for wchar_t, so the wstr representation can double as Py_UNICODE representation. It's too

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-28 Thread Stefan Behnel
Florian Weimer, 28.01.2011 15:27: * Stefan Behnel: The nice thing about Py_UNICODE is that is basically gives you native Unicode code points directly, without needing to decode UTF-8 byte runs and the like. In Cython, it allows you to do things like this: def test_for_those_characters

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-28 Thread Stefan Behnel
"Martin v. Löwis", 28.01.2011 22:49: And indeed, when Cython is updated to 3.3, it shouldn't access the UTF-8 representation for such a loop. Instead, it should access the str representation Sure. Regarding Cython specifically, the above will still be *possible* under the proposal, given tha

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-28 Thread Stefan Behnel
"Martin v. Löwis", 24.01.2011 21:17: I have been thinking about Unicode representation for some time now. This was triggered, on the one hand, by discussions with Glyph Lefkowitz (who complained that his server app consumes too much memory), and Carl Friedrich Bolz (who profiled Python applicatio

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-28 Thread Stefan Behnel
"Martin v. Löwis", 24.01.2011 21:17: I have been thinking about Unicode representation for some time now. This was triggered, on the one hand, by discussions with Glyph Lefkowitz (who complained that his server app consumes too much memory), and Carl Friedrich Bolz (who profiled Python applicatio

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-29 Thread Stefan Behnel
"Martin v. Löwis", 29.01.2011 10:05: None of the functions in this PEP become part of the stable ABI. I think that's only part of the truth. This PEP can potentially have an impact on the stable ABI in the sense that the build-time size of Py_UNICODE may no longer be important for extensions th

Re: [Python-Dev] PEP 393: Flexible String Representation

2011-01-29 Thread Stefan Behnel
"Martin v. Löwis", 24.01.2011 21:17: I'd like to propose PEP 393, which takes a different approach, addressing both problems simultaneously: by getting a flexible representation (one that can be either 1, 2, or 4 bytes), we can support the full range of Unicode on all systems, but still use only

Re: [Python-Dev] Byte code arguments from two to one byte: did anyone try this?

2011-01-31 Thread Stefan Behnel
Jurjen N.E. Bos, 31.01.2011 10:17: I single stepped a simple loop in Python to see where the efficiency bottlenecks are. What version of CPython did you try that with? The latest py3k branch? Stefan ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] API bloat

2011-02-10 Thread Stefan Behnel
Mark Shannon, 10.02.2011 11:16: Of course 743 functions is about 700 too many, Sorry, but that's so wrong, it's just being mean. What do you expect from a platform that has grown for more than 20 years? And which has been the only (real) Python implementation for most of that time. I'm sure

[Python-Dev] "Some" .pyc files not ending up in __pycache__ during installation

2011-02-19 Thread Stefan Behnel
Hi, sorry for asking here instead of filing a bug, but given that 3.2 final is pretty close, I wanted to make sure this gets considered. A Cython user noticed that the installation (setup.py install or bdist) puts several .pyc files into the installed source directory, instead of moving them

Re: [Python-Dev] "Some" .pyc files not ending up in __pycache__ during installation

2011-02-20 Thread Stefan Behnel
Georg Brandl, 19.02.2011 21:53: BTW, I haven't seen an issue yet. http://bugs.python.org/issue11254 Stefan ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mail

Re: [Python-Dev] Const-correctness in C-API Object Protocol

2011-02-22 Thread Stefan Behnel
Reid Kleckner, 22.02.2011 21:21: On Tue, Feb 22, 2011 at 2:09 PM, Eric Smith wrote: Also changing it now would be a giant hassle, leading to so-called "const poisoning" where many, many APIs need to be changed before everything would again work. The poisoning will not break any users of the AP

Re: [Python-Dev] PyCObject_AsVoidPtr removed from python 3.2 - is this documented?

2011-03-07 Thread Stefan Behnel
John Arbash Meinel, 07.03.2011 09:36: On 3/7/2011 3:56 AM, Terry Reedy wrote: On 3/6/2011 6:09 PM, Barry Scott wrote: I see that PyCObject_AsVoidPtr has been removed from python 3.2. The 3.2 docs do not seem to explain this has happened and what to replace it with. I searched the 3.2 docs and

[Python-Dev] public visibility of python-dev decisions "before it's too late" (was: PyCObject_AsVoidPtr removed from python 3.2 - is this documented?)

2011-03-08 Thread Stefan Behnel
"Martin v. Löwis", 08.03.2011 23:47: I think everything here is as it should be. People who really cared about forwards compatibility could have known, but factually, most people don't care enough. Those then learn for the first time that some feature was deprecated after it is actually removed.

Re: [Python-Dev] GPL'd python code vs Python2.6 linked against OpenSSL

2011-03-09 Thread Stefan Behnel
James Y Knight, 10.03.2011 06:52: But you're also left with not being able to 'import hashlib'. While python has fallback code, those modules (_md5, _sha, _sha256, _sha512) aren't built if openssl was found at build time. So you can't just select at runtime that you didn't want to use openssl.

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-15 Thread Stefan Behnel
Lennart Regebro, 16.03.2011 00:04: On Tue, Mar 15, 2011 at 18:56, Nick Coghlan wrote: why not just consider this another instance of the 2.x/3.x incompatibility? That's what it is after all. Apparently not, as the code already ran under Python 3.1. Personally, I would expect that breaking ba

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late"

2011-03-16 Thread Stefan Behnel
Eric Smith, 16.03.2011 04:12: On 3/15/2011 10:58 PM, Lennart Regebro wrote: On Tue, Mar 15, 2011 at 22:42, Guido van Rossum wrote: Fortunately there may not be any more such cases since no new major versions of Python 2 will be released. So I'm not sure what an update of PEP 5 will buy us. Th

Re: [Python-Dev] Low-Level Encoding Behavior on Python 3

2011-03-16 Thread Stefan Behnel
Armin Ronacher, 16.03.2011 16:57: On 3/16/11 3:48 AM, Antoine Pitrou wrote: I may be mistaken, but you seem to conflate two things: encoding of file names, and encoding of file contents. I guess that virtualenv chokes on the file contents, but most of your argument seems related to encoding of f

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-20 Thread Stefan Behnel
Nick Coghlan, 12.03.2011 12:43: I posted my rough notes and additional write-ups for Wednesday's VM summit and Thursday's language summit: http://www.boredomandlaziness.org/2011/03/python-vm-summit-rough-notes.html http://www.boredomandlaziness.org/2011/03/python-vm-summit-somewhat-coherent.html

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-20 Thread Stefan Behnel
Jesse Noller, 20.03.2011 12:32: On Sun, Mar 20, 2011 at 7:19 AM, Stefan Behnel wrote: It appears that there has been little mention of Cython at the summit, despite of the speed of CPython being a major topic, according to the notes. I can see several areas where Cython could help in speeding

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-20 Thread Stefan Behnel
Antoine Pitrou, 20.03.2011 12:40: On Sun, 20 Mar 2011 07:32:34 -0400 Jesse Noller wrote: The reason why there was no mention is probably because no one intimately familiar with Cython was there, and if they were - it was not brought up. If Cython supports PyPy - and Jython, and IronPython, your

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-20 Thread Stefan Behnel
Jesse Noller, 20.03.2011 13:51: ...snip IMHO, taking modules that currently only have a C implementation due to performance constraints and rewriting them in Cython is a much more worthwhile thing to do than adding an alternative pure Python implementation that other Python runtimes wouldn't us

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-20 Thread Stefan Behnel
Antoine Pitrou, 20.03.2011 15:51: On Sun, 20 Mar 2011 14:39:20 +0100, Stefan Behnel wrote: If anyone knows about a good benchmark for a currently pure Python standard library module, preferably a smaller, self-contained one that's somewhat computationally intensive, I'd be happy to

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-20 Thread Stefan Behnel
[warning, long post ahead] Guido van Rossum, 20.03.2011 17:17: Hi Stefan, Hi! I'm glad to see Cython picking up steam and trying to compete with CPython, PyPy, and possibly others. We do, although our main focus is much more on targeted manual optimisation rather than whole applications.

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-21 Thread Stefan Behnel
[long post ahead, again] Guido van Rossum, 21.03.2011 03:46: Thanks for the clarifications. I now have a much better understanding of what Cython is. But I'm not sold. For one, your attitude about strict language compatibility worries me when it comes to the stdlib. Not sure what you mean exac

Re: [Python-Dev] Deprecating non-Py_ssize_t use of PyArg_ParseTuple

2011-03-21 Thread Stefan Behnel
Victor Stinner, 21.03.2011 15:21: Le lundi 21 mars 2011 à 04:09 +0100, "Martin v. Löwis" a écrit : Since Python 2.5, we maintain two versions of PyArg_ParseTuple: one outputting int; the other one outputting Py_ssize_t. The former should have been removed in 3.0, but this was forgotten. Still,

Re: [Python-Dev] Deprecating non-Py_ssize_t use of PyArg_ParseTuple

2011-03-21 Thread Stefan Behnel
Victor Stinner, 21.03.2011 16:26: Le lundi 21 mars 2011 à 15:35 +0100, Stefan Behnel a écrit : Victor Stinner, 21.03.2011 15:21: Le lundi 21 mars 2011 à 04:09 +0100, "Martin v. Löwis" a écrit : Since Python 2.5, we maintain two versions of PyArg_ParseTuple: one outputting int; the

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-21 Thread Stefan Behnel
Stefan Behnel, 21.03.2011 11:58: Guido van Rossum, 21.03.2011 03:46: Have you tried replacing selected stdlib modules with their Cython-optimized equivalents in some of the NumPy/SciPy distros? (E.g. what about Enthought's Python distros?) Depending on how well that goes I might warm

Re: [Python-Dev] VM and Language summit info for those not at Pycon (and those that are!)

2011-03-21 Thread Stefan Behnel
"Martin v. Löwis", 21.03.2011 23:44: Am 21.03.2011 11:58, schrieb Stefan Behnel: Guido van Rossum, 21.03.2011 03:46: Thanks for the clarifications. I now have a much better understanding of what Cython is. But I'm not sold. For one, your attitude about strict language compatibi

Re: [Python-Dev] Python3: speed efficiency vs user friendliness (my first experience)

2011-03-23 Thread Stefan Behnel
Steven D'Aprano, 22.03.2011 22:12: anatoly techtonik wrote: I didn't touch Python3 until PyCon, and my first user experience is not really good. I've got a feeling that Python3 became more ugly, because it doesn't allow me to think about the logic anymore, and requires more low-level workarounds

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Stefan Behnel
bruce bushby, 24.03.2011 16:58: My main concern was that a freshly compiled Python attempts to open 168 non-existent files before starting. I understand that an interpreted language is probably not the best choice for an embedded device Well, "hello world" isn't exactly the benchmark I'd use f

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Stefan Behnel
bruce bushby, 24.03.2011 18:39: On Thu, Mar 24, 2011 at 5:05 PM, Stefan Behnel wrote: bruce bushby, 24.03.2011 16:58: On my desktop pc, when I run the most simple "Hello World" 78% of the overall execution time is spent opening filesmost of which don't exist. How

Re: [Python-Dev] Unload a module written in C

2011-03-25 Thread Stefan Behnel
"Martin v. Löwis", 25.03.2011 07:59: Is there a bug somewhere, or do I misunderstood something important? Module unloading is simply not implemented, and would be very difficult to implement. Are you saying that because objects instantiated from a module do not normally keep a reference to i

Re: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

2011-04-05 Thread Stefan Behnel
Brett Cannon, 05.04.2011 01:46: At both the VM and language summits at PyCon this year, the issue of compatibility of the stdlib amongst the various VMs came up. Two issues came about in regards to modules that use C code. One is that code that comes in only as C code sucks for all other VMs that

Re: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

2011-04-06 Thread Stefan Behnel
James Y Knight, 06.04.2011 17:03: On Apr 6, 2011, at 10:08 AM, Nick Coghlan wrote: Argument handling is certainly a tricky one - getting positional only arguments requires a bit of a hack in pure Python code (accepting *args and unpacking the arguments manually), but it comes reasonably naturall

Re: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

2011-04-06 Thread Stefan Behnel
Brett Cannon, 06.04.2011 19:40: On Tue, Apr 5, 2011 at 05:01, Nick Coghlan wrote: However, there actually *is* a significant semantic discrepancy in the heapq case, which is that py_heapq is duck-typed, while c_heapq is not: TypeError: heap argument must be a list That's true. I will re-word

Re: [Python-Dev] [GSoC] Developing a benchmark suite (for Python 3.x)

2011-04-08 Thread Stefan Behnel
Jesse Noller, 07.04.2011 22:28: On Thu, Apr 7, 2011 at 3:54 PM, Anthony Scopatz wrote: Hi Daniel, Thanks for putting this together. I am a huge supporter of benchmarking efforts. My brief comment is below. On Wed, Apr 6, 2011 at 11:52 AM, DasIch wrote: 1. Definition of the benchmark suite.

Re: [Python-Dev] [GSoC] Developing a benchmark suite (for Python 3.x)

2011-04-08 Thread Stefan Behnel
Maciej Fijalkowski, 08.04.2011 11:41: On Fri, Apr 8, 2011 at 11:22 AM, Stefan Behnel wrote: Jesse Noller, 07.04.2011 22:28: On Thu, Apr 7, 2011 at 3:54 PM, Anthony Scopatz wrote: Hi Daniel, Thanks for putting this together. I am a huge supporter of benchmarking efforts. My brief comment

Re: [Python-Dev] [GSoC] Developing a benchmark suite (for Python 3.x)

2011-04-08 Thread Stefan Behnel
Maciej Fijalkowski, 08.04.2011 13:37: On Fri, Apr 8, 2011 at 12:18 PM, Stefan Behnel wrote: So, once CPython is up and running in the benchmark test, adding Cython should be as easy as copying the configuration, installing Cython and adding two lines to site.py. can you provide a simple

Re: [Python-Dev] [GSoC] Developing a benchmark suite (for Python 3.x)

2011-04-11 Thread Stefan Behnel
Maciej Fijalkowski, 11.04.2011 11:39: On Fri, Apr 8, 2011 at 11:22 AM, Stefan Behnel wrote: Jesse Noller, 07.04.2011 22:28: On Thu, Apr 7, 2011 at 3:54 PM, Anthony Scopatz wrote: Hi Daniel, Thanks for putting this together. I am a huge supporter of benchmarking efforts. My brief comment

Re: [Python-Dev] peps: Update PEP 399 to include comments from python-dev.

2011-04-12 Thread Stefan Behnel
Antoine Pitrou, 13.04.2011 02:07: On Tue, 12 Apr 2011 19:50:34 -0400 Tres Seaver wrote: Trying to accelerate existing code which doesn't have the coverage is insane: how can you know that the accelerator doesn't subtly change the semantics without tests? Well, why do you think tests guarantee

Re: [Python-Dev] peps: Update PEP 399 to include comments from python-dev.

2011-04-13 Thread Stefan Behnel
Georg Brandl, 13.04.2011 08:54: On 13.04.2011 02:07, Antoine Pitrou wrote: On Tue, 12 Apr 2011 19:50:34 -0400 Tres Seaver wrote: Trying to accelerate existing code which doesn't have the coverage is insane: how can you know that the accelerator doesn't subtly change the semantics without tests

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-16 Thread Stefan Behnel
Antoine Pitrou, 16.04.2011 16:19: On Sat, 16 Apr 2011 09:50:25 + (UTC) Vinay Sajip wrote: If it is generally considered desirable to maintain some synchrony between simplejson and stdlib json, then since Bob has stated that he no interest in Python 3, it may be better to: 1. Convert the si

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-16 Thread Stefan Behnel
Matt Billenstein, 17.04.2011 00:47: On Sat, Apr 16, 2011 at 01:30:13PM +0200, Antoine Pitrou wrote: On Sat, 16 Apr 2011 00:41:03 + Matt Billenstein wrote: Slightly less crude benchmark showing simplejson is quite a bit faster: http://pastebin.com/g1WqUPwm 250ms vs 5.5s encoding and decod

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-17 Thread Stefan Behnel
Antoine Pitrou, 16.04.2011 19:27: On Sat, 16 Apr 2011 16:47:49 + (UTC) Vinay Sajip wrote: Bob made a comment in passing that simplejson (Python) is about as fast as stdlib json (C extension), on 2.x. I think Bob tested with an outdated version of the stdlib json module (2.6 or 2.7, perhaps

Re: [Python-Dev] Status of json (simplejson) in cpython

2011-04-17 Thread Stefan Behnel
Vinay Sajip, 17.04.2011 12:33: Antoine Pitrou writes: Feel free to share your numbers. I've now got my fork working on Python 3.2 with speedups. According to a non-scientific simple test: Python 2.7 == Python version: 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) [GCC 4.5.2] 11.21484375

Re: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

2011-04-18 Thread Stefan Behnel
Maciej Fijalkowski, 18.04.2011 19:11: On Mon, Apr 18, 2011 at 6:32 PM, Éric Araujo wrote: We try very hard to optimize for usual python idioms. They're very often much better than specific cpython hacks. Unless you mean things like rebiding a global into default a "pythonic idiom". We had to rew

Re: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

2011-04-18 Thread Stefan Behnel
Raymond Hettinger, 18.04.2011 19:26: On Apr 18, 2011, at 10:11 AM, Maciej Fijalkowski wrote: * we usually target CPython version that's already frozen, which is pretty inconvinient to post this changes back. Example would be a socket module where it has changed enough in 3.x that 2.7 changes ma

Re: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

2011-04-18 Thread Stefan Behnel
R. David Murray, 18.04.2011 14:30: On Mon, 18 Apr 2011 09:36:20 +0100, Paul Moore wrote: On 18 April 2011 08:05, Maciej Fijalkowski wrote: On Sun, Apr 17, 2011 at 4:19 AM, Raymond Hettinger wrote: The PEP seems to be predicated on a notion that anything written in C is bad and that all testin

Re: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

2011-04-18 Thread Stefan Behnel
Brett Cannon, 05.04.2011 01:46: At both the VM and language summits at PyCon this year, the issue of compatibility of the stdlib amongst the various VMs came up. Two issues came about in regards to modules that use C code. One is that code that comes in only as C code sucks for all other VMs that

Re: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements

2011-04-19 Thread Stefan Behnel
Nick Coghlan, 19.04.2011 10:57: On Tue, Apr 19, 2011 at 3:06 PM, Stefan Behnel wrote: I think this social problem of the PEP can only be solved if the CPython project stops doing the major share of the stdlib maintenance, thus freeing its own developer capacities to focus on CPython related

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-28 Thread Stefan Behnel
DasIch, 28.04.2011 20:55: the CPython benchmarks have an extensive set of microbenchmarks in the pybench package Try not to care too much about pybench. There is some value in it, but some of its microbenchmarks are also tied to CPython's interpreter behaviour. For example, the benchmarks for

Re: [Python-Dev] Proposal for a common benchmark suite

2011-04-28 Thread Stefan Behnel
M.-A. Lemburg, 28.04.2011 22:23: Stefan Behnel wrote: DasIch, 28.04.2011 20:55: the CPython benchmarks have an extensive set of microbenchmarks in the pybench package Try not to care too much about pybench. There is some value in it, but some of its microbenchmarks are also tied to CPython&#

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Stefan Behnel
Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html From that note: 1: You can't have meaningful destructors, because when destruction happens is u

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Stefan Behnel
Michael Foord, 06.05.2011 19:06: On 06/05/2011 17:51, Stefan Behnel wrote: Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Stefan Behnel
Mark Shannon, 06.05.2011 20:45: Stefan Behnel wrote: Michael Foord, 06.05.2011 19:06: On 06/05/2011 17:51, Stefan Behnel wrote: Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.

<    1   2   3   4   5   6   7   >