[issue2483] int and float accept bytes, complex does not

2008-03-26 Thread Gabriel Genellina

Gabriel Genellina [EMAIL PROTECTED] added the comment:

Are numbers so special to break 
the rules? why stopping here? 
what about other types that may 
want to accept ASCII bytes 
instead of characters? Isn't 
this like going back to the 2.x 
world?

The protocol with embedded ASCII 
numbers isn't a very convincing 
case for me. One can read a 
binary integer in C using a 
single function call. In Python 
2.X this can't be done in a 
single call, one has to use 
struct.unpack to decode the 
bytes read, and there was no 
complains that I know of. 
In 3.0 the same happens for 
ASCII numbers too, one will have 
to decode them first. The 
conversion may look like a 
stupid step, but it's as stupid 
as having to use struct.unpack 
to convert some bits to the 
*same* bits inside the integer 
object.

Writing int(str(value,'ascii')) 
doesn't look so terrible.

And one may argue that 
int(b'1234') should return 
0x34333231 instead of 1234; 
b'1234' is the binary 
representation of 0x34333231 in 
little-endian format.

--
nosy: +gagenellina

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2483
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2483] int and float accept bytes, complex does not

2008-03-26 Thread Nick Coghlan

Nick Coghlan [EMAIL PROTECTED] added the comment:

Agreed - I've been convinced that the right thing to do is reject bytes
in int() and float() as well.

If we decide we still want to support a fast-path conversion it should
be via separate methods (e.g an int.from_ascii class method and an
int.to_ascii instance method).

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2483
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2488] Backport sys.maxsize to Python 2.6

2008-03-26 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

What about #1570?

--
nosy: +georg.brandl

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2488
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2488] Backport sys.maxsize to Python 2.6

2008-03-26 Thread Raymond Hettinger

Raymond Hettinger [EMAIL PROTECTED] added the comment:

FWIW, I don't see how backports like this add any value at all. The 2-
to-3 tool handles renaming well, but a backport just creates a hodge-
podge of aliases making the language harder to learn and harder to grep.

--
nosy: +rhettinger

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2488
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2484] Cosmetic patch for warning unused variable

2008-03-26 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Thanks, fixed in r61927.

--
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2484
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2457] add --help and -h options to pdb

2008-03-26 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Go ahead and commit.

--
resolution:  - accepted

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2457
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2491] io.open() handles errors differently on different platforms

2008-03-26 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

With python3.0, os.fdopen() is a simple call to io.open(), which has
these missing options.

Maybe os.fdopen should be deprecated or removed, and replaced by io.open.
Moreover, the comment in os.py is wrong: subprocess does not use fdopen
any more, but io.open instead.

--
nosy: +amaury.forgeotdarc

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2491
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2490] Assertion failure in datetime.strftime()

2008-03-26 Thread Pierre Metras

Pierre Metras [EMAIL PROTECTED] added the comment:

There is an example of a long strftime pattern in the test.py file 
attached to that issue. Just change the length of the pattern to see 
that it works for smaller patterns in Python 2.5.

The pattern where it occured in my application is a Pango markup 
string used for localization:
markupspan lang=\en\ font_desc=\Sans,Monospace Bold 130\span 
foreground=\#FF\%H/span:span 
foreground=\#00FF00\%M/span:span 
foreground=\#FF\%S/span/span/markup

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2490
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2492] Check implementation of new buffer interface for PyString in 2.6

2008-03-26 Thread Christian Heimes

New submission from Christian Heimes [EMAIL PROTECTED]:

I've only implemented (getbufferproc)string_buffer_getbuffer of the new
buffer protocol. Do I have to add exports to the PyString struct and
add a releasebufferproc, too?

--
components: Interpreter Core
keywords: 26backport
messages: 64550
nosy: tiran
priority: high
severity: normal
status: open
title: Check implementation of new buffer interface for PyString in 2.6
type: behavior
versions: Python 2.6

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2492
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2457] add --help and -h options to pdb

2008-03-26 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Committed in r61931.

--
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2457
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2492] Check implementation of new buffer interface for PyString in 2.6

2008-03-26 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

By the way the code is in
svn+ssh://[EMAIL PROTECTED]/python/branches/trunk-bytearray

--
nosy: +teoliphant

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2492
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2490] Assertion failure in datetime.strftime()

2008-03-26 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

I cannot reproduce this with test.py with Python 2.5.1 on x86 Linux.

--
nosy: +georg.brandl

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2490
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2250] rlcompleter raises Exception on bad input

2008-03-26 Thread Lorenz Quack

Lorenz Quack [EMAIL PROTECTED] added the comment:

I was thinking that the code in question could maybe also raise other
exceptions. too bad I´m on vacation and can´t try this out myself.
I believe the regular expression also matches something like 

import rlcompleter
rlcompleter.Completer().complete(1foo.2bar3.smth, 0)

which I guess would result in a SyntaxError. 
would be nice if someone could verify that.

If I´m right I see two possibilities. either change the regular
expression to match only valid python identifieres or also catch
SyntaxErrors.

could there be any other exception? (In the face of ambiguity, refuse
the temptation to guess.)

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2250
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1561] py3k: test_mailbox fails on Windows

2008-03-26 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Three months later, one obvious correction: open all (text) files with
the newline='\n' option.

- This makes files identical between Unix and Windows version
- no more os.linesep

A compatibility problem: mailboxes created with python2.6 cannot be
opened with 3.0

--
keywords: +patch
Added file: http://bugs.python.org/file9865/mailbox.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1561
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2479] Bytearray and io backport

2008-03-26 Thread Quentin Gallet-Gilles

Quentin Gallet-Gilles [EMAIL PROTECTED] added the comment:

I've just updated my trunk checkout on Ubuntu and run the regression
test suite. All tests OK.

--
nosy: +quentin.gallet-gilles

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2479
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1561] py3k: test_mailbox fails on Windows

2008-03-26 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Another patch, which uses newline='' instead. Tests pass.
The patch is much smaller, and old files are more likely to be compatible.

OTOH, messages are unicode strings with \r\n.

Which one do you prefer?

Added file: http://bugs.python.org/file9866/mailbox2.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1561
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2402] get rid of warnings in regrtest with -3

2008-03-26 Thread Quentin Gallet-Gilles

Changes by Quentin Gallet-Gilles [EMAIL PROTECTED]:


--
nosy: +quentin.gallet-gilles

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2402
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2493] Remove unused constants from optimized code objects

2008-03-26 Thread Alexander Belopolsky

New submission from Alexander Belopolsky [EMAIL PROTECTED]:

When peephole optimizer folds multiple constants into one, the old 
constants remain in co_consts.  Attached patch removes such unused 
constants.

--
components: Interpreter Core
files: compress-consts.diff
keywords: patch
messages: 64558
nosy: belopolsky
severity: normal
status: open
title: Remove unused constants from optimized code objects
type: resource usage
versions: Python 2.6
Added file: http://bugs.python.org/file9867/compress-consts.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2493
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2490] Assertion failure in datetime.strftime()

2008-03-26 Thread Pierre Metras

Pierre Metras [EMAIL PROTECTED] added the comment:

I did a mistake: OLPC XO is based on Fedora 7 and not 9. They plan to 
upgrade to 9 later this year (http://wiki.laptop.org/go/Fedora), so 
this bug will disappear by itself if it's confirmed that test.py runs 
correctly on Python 2.5.x and Fedora 9 ships with the latest version.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2490
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1222721] tk + setlocale problems...

2008-03-26 Thread ghorvath

ghorvath [EMAIL PROTECTED] added the comment:

I can confirm that this bug is still present. After
locale.setlocale(locale.LC_ALL, '') Backspace in Tkinter.Entry is not
working anymore. 
There is no difference if the Backspace is issued by the keyboard or by
self.master.winfo_toplevel().event_generate('BackSpace')

No messages are written.
Tested on Linux (Ubuntu Gutsy)/Python 2.5.1 and Windows XP/Python 2.4.3

--
nosy: +ghorvath
versions: +Python 2.5

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1222721
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2493] Remove unused constants from optimized code objects

2008-03-26 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

I've noticed that the original patch does not handle the error condition 
from failed consts resize correctly.  Please see compress-consts-1.diff 
for a fix.

Added file: http://bugs.python.org/file9868/compress-consts-1.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2493
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1518] Fast globals/builtins access (patch)

2008-03-26 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' [EMAIL PROTECTED]:


--
nosy: +giampaolo.rodola

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1518
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1222721] tk + setlocale problems...

2008-03-26 Thread ghorvath

ghorvath [EMAIL PROTECTED] added the comment:

Attached a workaround for this problem, based on:
http://ml.osdir.com/games.mud.client.lyntin/2005-03/msg5.html

I also found that the problem only appears when the LC_NUMERIC setting
is different to en_US. (for example if it is de_AT)

Added file: http://bugs.python.org/file9869/tksetlocalebug.py

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1222721
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2490] Assertion failure in datetime.strftime()

2008-03-26 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

Okay, closing as out of date.

--
resolution:  - out of date
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2490
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2268] Fold slice constants

2008-03-26 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

Just to quantify the improvement:

Before:

$ ./python -m timeit -sx='abc' x[::-1]
100 loops, best of 3: 0.305 usec per loop
$ ./python -O -m timeit -sx='abc' x[::-1]
100 loops, best of 3: 0.275 usec per loop

After:

$ ./python -m timeit -sx='abc' x[::-1]
100 loops, best of 3: 0.262 usec per loop
$ ./python -O -m timeit -sx='abc' x[::-1]
100 loops, best of 3: 0.253 usec per loop

For some reason, when I run pybench, the timings vary from run to run so
much that I cannot even tell the difference.  (Run to run differences
are larger than patched to original.)

FWIW, the micro-benchmark above shows 8% improvement with -O and 14%
improvement without.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2268
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1413192] bsddb: segfault on db.associate call with Txn and large data

2008-03-26 Thread Jesús Cea Avión

Changes by Jesús Cea Avión [EMAIL PROTECTED]:


--
nosy: +jcea

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1413192
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2458] Allow Python code to change Py3k warning flag

2008-03-26 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Raising priority so this is looked at before we release 2.6. :)

--
priority:  - critical

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2458
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1503] test_xmlrpc is still flakey

2008-03-26 Thread Ralf Schmitt

Ralf Schmitt [EMAIL PROTECTED] added the comment:

The current buildbot has errors similar to this one (I assume):

Exception happened during processing of request from ('127.0.0.1', 53126)
Traceback (most recent call last):
  File /Users/ralf/trunk/Lib/SocketServer.py, line 281, in
_handle_request_noblock
self.process_request(request, client_address)
  File /Users/ralf/trunk/Lib/SocketServer.py, line 307, in process_request
self.finish_request(request, client_address)
  File /Users/ralf/trunk/Lib/SocketServer.py, line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File /Users/ralf/trunk/Lib/SocketServer.py, line 615, in __init__
self.handle()
  File /Users/ralf/trunk/Lib/BaseHTTPServer.py, line 318, in handle
self.handle_one_request()
  File /Users/ralf/trunk/Lib/BaseHTTPServer.py, line 301, in
handle_one_request
self.raw_requestline = self.rfile.readline()
  File /Users/ralf/trunk/Lib/socket.py, line 369, in readline
data = self._sock.recv(self._rbufsize)
error: [Errno 35] Resource temporarily unavailable


 

The problem is that the test calls
 
 serv.socket.settimeout(3)

in the http_server function. This implicitly sets the server socket to
nonblocking state.
The accept call then returns a socket object, which
- is blocking on OS X 10.4 ppc
- is nonblocking on linux

I can easily reproduce that on my mac mini g4 with python 2.6.

--
nosy: +schmir
versions: +Python 2.6

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1503
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1503] test_xmlrpc is still flakey

2008-03-26 Thread Ralf Schmitt

Ralf Schmitt [EMAIL PROTECTED] added the comment:

I just double checked with the following program:
#! /usr/bin/env python

import os
import fcntl
import socket


def isnonblocking(fd):

return bool(fcntl.fcntl(fd, fcntl.F_GETFL, 0)  os.O_NONBLOCK)

def main():
s=socket.socket()

s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((0.0.0.0, 8000))
s.listen(5)

s.settimeout(30)


print server isnonblocking:, isnonblocking(s.fileno())
client, addr = s.accept()
print client isnonblocking:, isnonblocking(client.fileno())



if __name__==__main__:
main()



on my g4 mac it prints:
~/ python serv.py 
[EMAIL PROTECTED] ok
server isnonblocking: True
client isnonblocking: True


on linux:
~/ python mini/serv.py   
[EMAIL PROTECTED] ok
server isnonblocking: True
client isnonblocking: False

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1503
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1503] test_xmlrpc is still flakey

2008-03-26 Thread Ralf Schmitt

Ralf Schmitt [EMAIL PROTECTED] added the comment:

now that I see that the buildbot was running on ppc *Debian* I'm not
quite sure if we're talking about the same issue.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1503
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1503] test_xmlrpc is still flakey

2008-03-26 Thread Alan McIntyre

Alan McIntyre [EMAIL PROTECTED] added the comment:

It's my fault the xmlrpc tests try to use non-blocking sockets.  That
got added because sometimes failing tests would just sit there with the
server blocking until the entire test process got killed for running too
long.

There are some tests that are skipped in test_xmlrpc because of
(apparent) Windows socket quirks; should they also be skipped for OS X
PPC, or should the flaky tests just be scrapped?

When I was last working on this I couldn't come up with a better way to
run these tests, so unless somebody can suggest a new approach I'm just
left with recommending the skip  scrap options as the only way to stop
the flakiness.

--
nosy: +alanmcintyre

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1503
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1503] test_xmlrpc is still flakey

2008-03-26 Thread Ralf Schmitt

Ralf Schmitt [EMAIL PROTECTED] added the comment:

No, please do not disable them. I'm not quite sure what to do, but
apparently these sockets returned from accept should be turned into
blocking sockets.
I just do not know, where this should happen. I think that this could
even be done inside the accept call (which then might break some code).
At least it should be done in the BaseHTTPServer code, which apparently
cannot handle nonblocking sockets.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1503
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1503] test_xmlrpc is still flakey

2008-03-26 Thread Ralf Schmitt

Ralf Schmitt [EMAIL PROTECTED] added the comment:

With the following diff, test_xmlrpc.py passes without problems.

Like I said, someone else should decide where to turn on blocking mode.
I now think that it should be in the socket.accept (i.e. in the C code)
at least for unix platforms.
Those who really want a nonblocking socket, will most probably call that
setblocking(0) anyway (or their program is broken on linux, which
returns blocking sockets by default).



--- a/Lib/SocketServer.py   Wed Mar 26 22:41:36 2008 +0100
+++ b/Lib/SocketServer.py   Wed Mar 26 23:48:13 2008 +0100
@@ -441,8 +441,10 @@
 May be overridden.
 
 
-return self.socket.accept()
-
+r= self.socket.accept()
+r[0].setblocking(1)
+return r
+
 def close_request(self, request):
 Called to clean up an individual request.
 request.close()

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1503
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2459] speedup loops with better bytecode

2008-03-26 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

This new patch completes the bytecode modifications. For/while loops as
well as list comprehensions and generator expressions are a bit faster
now. Also, as a side effect I've introduced a speed improvement for if
statements and expressions...

Some micro-benchmarks (completing the ones already given above):

./python Tools/pybench/pybench.py -t IfThenElse
Before: 167ms per round
After: 136ms per round

./python -m timeit -s y=range(100) sum(x for x in y)
Before: 1 loops, best of 3: 20.4 usec per loop
After: 10 loops, best of 3: 17.9 usec per loop

./python -m timeit -s y=range(100) sum(x for x in y if x)
Before: 1 loops, best of 3: 28.5 usec per loop
After: 1 loops, best of 3: 23.3 usec per loop

./python -m timeit -s y=range(100) sum(x for x in y if not x)
Before: 10 loops, best of 3: 16.4 usec per loop
After: 10 loops, best of 3: 12.1 usec per loop

./python -m timeit -s x,y,z=1,2,3 x if y else z
Before: 100 loops, best of 3: 0.218 usec per loop
After: 1000 loops, best of 3: 0.159 usec per loop

A couple of tests seem to be failing in obscure ways in the test suite,
I'll try to examine them. Most of the test suite runs fine though.

Added file: http://bugs.python.org/file9870/loops6.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2459
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2459] speedup loops with better bytecode

2008-03-26 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Ok, the fix for the bizarre failures was really simple. Now the only
failing tests are in test_trace (because it makes assumptions regarding
the bytecode that aren't true anymore, I'll have to adapt the tests).

Added file: http://bugs.python.org/file9871/loops7.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2459
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2487] ldexp(x,n) misbehaves when abs(n) is large

2008-03-26 Thread Mark Dickinson

Mark Dickinson [EMAIL PROTECTED] added the comment:

There are similar problems with integer shifts.  In the trunk:

 1(2**40)
Traceback (most recent call last):
  File stdin, line 1, in module
OverflowError: long int too large to convert to int

and in Python 3.0:

 1(2**40)
Traceback (most recent call last):
  File stdin, line 1, in module
OverflowError: Python int too large to convert to C long

These should probably by fixed, too, though at least the error
message is clear.

What should 1(2**31) do?

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2487
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2422] Automatically disable pymalloc when running under valgrind

2008-03-26 Thread James Henstridge

James Henstridge [EMAIL PROTECTED] added the comment:

An updated version of the patch.  The previous ones were missing the
valgrind check, resulting in the pymalloc code paths being executed
(which in turn cause unintialised read warnings from valgrind).

Added file: 
http://bugs.python.org/file9872/disable-pymalloc-on-valgrind-py26.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2422
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1622] zipfile hangs on certain zip files

2008-03-26 Thread Eric Huss

Eric Huss [EMAIL PROTECTED] added the comment:

Sorry for the long delay.  Yes, the latest patch looks very good to me.

-Eric

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1622
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2459] speedup loops with better bytecode

2008-03-26 Thread Neal Norwitz

Neal Norwitz [EMAIL PROTECTED] added the comment:

Antoine, I hope to look at this patch eventually.  Unfortunately, there
are too many build/test problems that need to be resolved before the
next release.  If you can help out with those, I will be able to review
this patch sooner.

--
nosy: +nnorwitz

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2459
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-03-26 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file9424/ocean.zip

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-03-26 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file9456/ocean.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-03-26 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file9577/ocean.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-03-26 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:


Removed file: http://bugs.python.org/file9595/ocean.zip

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2065] trunk version does not compile with vs8 and vc6

2008-03-26 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file9873/ocean.zip

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2065
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com