Re: [Python-Dev] is sys.modules not meant to be replaced?

2011-07-23 Thread Nick Coghlan
On Sun, Jul 24, 2011 at 3:05 PM, Eric Snow wrote: > Are there other objects in the interpreter state that are exposed in > sys that would have the same problem? Rebinding (rather than mutating) any global state in any module is always dubious due to the potential for direct references to the prev

Re: [Python-Dev] 3.2.1 encoding surprise

2011-07-23 Thread Glenn Linderman
On 7/23/2011 5:34 AM, Vinay Sajip wrote: Glenn Linderman g.nevcal.com> writes: I aim to update the launcher downloads Real Soon Now. Has fixed my problem with not having a local py.ini file, and now is picking up python=3 from the py.ini coresident to the py.exe. Thanks, Mark & Vinay. ___

Re: [Python-Dev] is sys.modules not meant to be replaced?

2011-07-23 Thread Benjamin Peterson
2011/7/24 Eric Snow : > On Sat, Jul 23, 2011 at 10:55 PM, Benjamin Peterson > wrote: >> 2011/7/23 Eric Snow : >>> The documentation[1] doesn't say, but the implementation of the imp >>> module makes me wonder if sys.modules was not meant to be replaceable. >>>  No doubt this has to do with its ti

Re: [Python-Dev] is sys.modules not meant to be replaced?

2011-07-23 Thread Eric Snow
On Sat, Jul 23, 2011 at 10:55 PM, Benjamin Peterson wrote: > 2011/7/23 Eric Snow : >> The documentation[1] doesn't say, but the implementation of the imp >> module makes me wonder if sys.modules was not meant to be replaceable. >>  No doubt this has to do with its tie to the interpreter's modules

Re: [Python-Dev] is sys.modules not meant to be replaced?

2011-07-23 Thread Benjamin Peterson
2011/7/23 Eric Snow : > The documentation[1] doesn't say, but the implementation of the imp > module makes me wonder if sys.modules was not meant to be replaceable. >  No doubt this has to do with its tie to the interpreter's modules > dict.  I ran into this doing "sys.modules = sys.modules.copy()"

[Python-Dev] is sys.modules not meant to be replaced?

2011-07-23 Thread Eric Snow
The documentation[1] doesn't say, but the implementation of the imp module makes me wonder if sys.modules was not meant to be replaceable. No doubt this has to do with its tie to the interpreter's modules dict. I ran into this doing "sys.modules = sys.modules.copy()" to protect the actual sys.mod

[Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-23 Thread Eli Bendersky
Some background: I'm working (on and off) on issue 11015 - documenting the public functions in test.support Some of the functions in test.support (for example unlink, rmtree) simply shadow existing & popular stdlib functions, with the aim of swallowing the exceptions these may throw. This is confu

Re: [Python-Dev] [PEPs] Rebooting PEP 394 (aka Support the /usr/bin/python2 symlink upstream)

2011-07-23 Thread Kerrick Staley
I put up a tracker issue at http://bugs.python.org/issue12627 There are patches for 2.7 as well as tip, but they only fix the Makefiles; no changes are done to documentation. Also, Ned, it appears that Python 2.7 doesn't install the Idle or PyDoc binaries (grep the 2.7 Makefile to see what I mean

Re: [Python-Dev] tuple[int] optimization

2011-07-23 Thread Raymond Hettinger
On Jul 23, 2011, at 5:18 PM, Antoine Pitrou wrote: > > My point is that on non-trivial benchmarks, the savings are almost zero. That could be said of any optimization in Python. Typical Python scripts exercise many features at time, so any one optimization by itself if almost useless. Collective

Re: [Python-Dev] tuple[int] optimization

2011-07-23 Thread Andrew Svetlov
I undrestand your point. Thank you for explanation. On Sun, Jul 24, 2011 at 3:18 AM, Antoine Pitrou wrote: > Le dimanche 24 juillet 2011 à 03:15 +0300, Andrew Svetlov a écrit : >> You right. Sorry, I missed changes in ceval.c for py3k. >> Please note, simple test like: >> >> from timeit import ti

Re: [Python-Dev] tuple[int] optimization

2011-07-23 Thread Antoine Pitrou
Le dimanche 24 juillet 2011 à 03:15 +0300, Andrew Svetlov a écrit : > You right. Sorry, I missed changes in ceval.c for py3k. > Please note, simple test like: > > from timeit import timeit > > print('list', timeit("l[0]", "l = [1]")) > print('tuple', timeit("l[0]", "l = (1,)")) > > Has results:

Re: [Python-Dev] tuple[int] optimization

2011-07-23 Thread Andrew Svetlov
You right. Sorry, I missed changes in ceval.c for py3k. Please note, simple test like: from timeit import timeit print('list', timeit("l[0]", "l = [1]")) print('tuple', timeit("l[0]", "l = (1,)")) Has results: andrew@ocean ~/p/cpython> python2.7 z.py ('list', 0.03479599952697754) ('tuple', 0.04

Re: [Python-Dev] tuple[int] optimization

2011-07-23 Thread Antoine Pitrou
On Sun, 24 Jul 2011 09:13:07 +1000 Ryan Kelly wrote: > > In latest trunk this optimisation seems to have gone away, the code is > now: > > TARGET(BINARY_SUBSCR) > w = POP(); > v = TOP(); > x = PyObject_GetItem(v, w); > Py_DECREF(v); >

Re: [Python-Dev] tuple[int] optimization

2011-07-23 Thread Ryan Kelly
On Sun, 2011-07-24 at 01:20 +0300, Andrew Svetlov wrote: > tuple[int] is 30% slower than list[int]. > Please let me explain the problem. > > (1, 2, 3)[1] has compiled as BINARY_SUBSCR operation. > ceval.c has optimization for list: > > case BINARY_SUBSCR: > w = POP(); >

[Python-Dev] tuple[int] optimization

2011-07-23 Thread Andrew Svetlov
tuple[int] is 30% slower than list[int]. Please let me explain the problem. (1, 2, 3)[1] has compiled as BINARY_SUBSCR operation. ceval.c has optimization for list: case BINARY_SUBSCR: w = POP(); v = TOP(); if (PyList_CheckExact(v) && PyInt_CheckExact(w

Re: [Python-Dev] cpython: Merge - Issue #12592: Make Python build on OpenBSD 5 (and future major

2011-07-23 Thread Charles-François Natali
> Ok, it should be fixed now. > Indeed. Thanks! cf ___ 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.com

Re: [Python-Dev] cpython: Merge - Issue #12592: Make Python build on OpenBSD 5 (and future major

2011-07-23 Thread Antoine Pitrou
On Sat, 23 Jul 2011 16:10:38 +0200 Charles-François Natali wrote: > > No traceback. > Last time I did a push (yesterday), there was a slight difference, the > lines reporting the failure were prefixed by "buildbot:" (IIRC). And > indeed, none of my pushes triggers a build on the buildbots (and I'

Re: [Python-Dev] cpython: Merge - Issue #12592: Make Python build on OpenBSD 5 (and future major

2011-07-23 Thread Charles-François Natali
(See http://mail.python.org/pipermail/python-dev/2011-July/112309.html for the original mail): """ $ hg push pushing to ssh://h...@hg.python.org/cpython searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 2 changes to

Re: [Python-Dev] cpython: Merge - Issue #12592: Make Python build on OpenBSD 5 (and future major

2011-07-23 Thread Antoine Pitrou
On Sat, 23 Jul 2011 11:46:05 +0200 Charles-François Natali wrote: > > Note that this commit wasn't actually a merge -- you'll have to use the > > "hg merge" command for that. > > You're right. > I guess that's what happens when I try to work past my usual bedtime ;-) > > By the way, I'm still g

Re: [Python-Dev] 3.2.1 encoding surprise

2011-07-23 Thread Vinay Sajip
Glenn Linderman g.nevcal.com> writes: I aim to update the launcher downloads Real Soon Now. > What (free?) toolset is needed for building the launcher?  I don't > even have a C compiler installed on this computer yet. > The tools I use for building the launcher are: Windows SDK (for t

Re: [Python-Dev] cpython: Merge - Issue #12592: Make Python build on OpenBSD 5 (and future major

2011-07-23 Thread Charles-François Natali
> Note that this commit wasn't actually a merge -- you'll have to use the > "hg merge" command for that. You're right. I guess that's what happens when I try to work past my usual bedtime ;-) By the way, I'm still getting errors upon push, and it looks like when I push a patch, this doesn't trigg

Re: [Python-Dev] [Python-checkins] r88867 - in tracker/instances/python-dev: extensions/pydevutils.py html/file.item.html html/issue.item.html html/msg.item.html

2011-07-23 Thread Ezio Melotti
On 23/07/2011 9.55, Nick Coghlan wrote: On Sat, Jul 23, 2011 at 8:34 AM, ezio.melotti wrote: Author: ezio.melotti Date: Sat Jul 23 00:34:53 2011 New Revision: 88867 Log: #267: remove the remove button from the issue page, move it to the msg/file page, and add a button to add back removed mes

Re: [Python-Dev] cpython: Merge - Issue #12592: Make Python build on OpenBSD 5 (and future major

2011-07-23 Thread Georg Brandl
Am 22.07.2011 23:51, schrieb charles-francois.natali: > http://hg.python.org/cpython/rev/63de97ae832e > changeset: 71462:63de97ae832e > parent: 71459:d3f0f72c31f8 > user:Charles-François Natali > date:Fri Jul 22 23:52:02 2011 +0200 > summary: > Merge - Issue #12592: Make P

Re: [Python-Dev] [Python-checkins] r88867 - in tracker/instances/python-dev: extensions/pydevutils.py html/file.item.html html/issue.item.html html/msg.item.html

2011-07-23 Thread Nick Coghlan
On Sat, Jul 23, 2011 at 8:34 AM, ezio.melotti wrote: > Author: ezio.melotti > Date: Sat Jul 23 00:34:53 2011 > New Revision: 88867 > > Log: > #267: remove the remove button from the issue page, move it to the msg/file > page, and add a button to add back removed messages/files. Thank you! (I acc