Andrew Bennetts added the comment:
googletest (an xUnit style C++ test framework) has an interesting feature: in
addition to assertions like ASSERT_EQ(x, y) that stop the test, it has
EXPECT_EQ(x, y) etc that will cause the test to fail without causing it to
stop. I think this decoupling
Andrew Bennetts s...@users.sourceforge.net added the comment:
You may be interested an existing, unittest-compatible library that provides
this: http://pypi.python.org/pypi/testscenarios
--
nosy: +spiv
___
Python tracker rep...@bugs.python.org
http
Andrew Bennetts s...@users.sourceforge.net added the comment:
Here's a conservative fix for Python 2.7. It replaces the attempts to call
baseclass.method with direct calls to the decorated object (i.e. replace
socket.meth(self, ...) with self._sock.meth(...)).
It also corrects a bunch
New submission from Andrew Bennetts s...@users.sourceforge.net:
ython 2.6.6 (r266:84292, Aug 24 2010, 21:47:18)
[GCC 4.4.5 20100816 (prerelease)] on linux2
Type help, copyright, credits or license for more information.
import socket, ssl
s = socket.socket()
wrapped = ssl.wrap_socket(s
Changes by Andrew Bennetts s...@users.sourceforge.net:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9729
___
___
Python-bugs
Andrew Bennetts s...@users.sourceforge.net added the comment:
I have a reproduction script on the Ubuntu bug report I just filed for this
issue: https://bugs.launchpad.net/ubuntu/+source/python2.6/+bug/615240
Pasting here for convenience:
import socket
import threading
sock_a, sock_b
Andrew Bennetts s...@users.sourceforge.net added the comment:
On 2010-05-17 rhettinger wrote:
Will look at this when I get back to the U.S.
Ping! This patch (set-difference-speedup-2.diff) has been sitting around for a
fair few weeks now. It's a small patch, so it should be relatively easy
Andrew Bennetts s...@users.sourceforge.net added the comment:
Chatting with Taggnostr on IRC I've trimmed that reproduction down to something
much cleaner (no magic numbers or threads involved):
import socket
sock_a, sock_b = socket.socketpair()
sock_a = socket.socket(_sock=sock_a
Andrew Bennetts s...@users.sourceforge.net added the comment:
Alexander: yes, they are complementary. My patch improves set.difference,
which always creates a new set. issue8425 on the other hand improves in-place
difference (via the -= operator or set.difference_update). Looking at the two
Andrew Bennetts s...@users.sourceforge.net added the comment:
Antoine: Thanks for the updated benchmark results! I should have done that
myself earlier.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8685
Changes by Andrew Bennetts s...@users.sourceforge.net:
Added file: http://bugs.python.org/file17306/set-mem.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8685
Andrew Bennetts s...@users.sourceforge.net added the comment:
Regarding memory, good question... but this patch turns out to be an
improvement there too.
This optimisation only applies when len(x) len(y) * 4. So the minimum size
of the result is a set with 3/4 of the elems of x
New submission from Andrew Bennetts s...@users.sourceforge.net:
set.difference(s), when s is also a set, basically does::
res = set()
for elem in self:
if elem not in other:
res.add(elem)
This is wasteful when len(self) is much greater than len(other):
$ python -m
Andrew Bennetts s...@users.sourceforge.net added the comment:
Oops, obvious bug in this patch. set('abc') - set('bcd') != set('bcd') -
set('abc'). I'll see if I can make a more sensible improvement.
See also http://bugs.python.org/issue8425. Thanks dickinsm on #python-dev
Andrew Bennetts s...@users.sourceforge.net added the comment:
Ok, this time test_set* passes :)
Currently if you have large set and small set the code will do len(large)
lookups in the small set. When large is than small, it is cheaper to copy
large and do len(small) lookups in large
Andrew Bennetts s...@users.sourceforge.net added the comment:
Your patches look good to me.
(They don't fix platforms without sigaction, but as you say they probably don't
have siginterrupt, and even if they do they will still have an unfixable race.)
What's the next step? I can't see
Andrew Bennetts s...@users.sourceforge.net added the comment:
Are there any platforms that define HAVE_SIGINTERRUPT but that do not define
HAVE_SIGACTION? If there are, then yes I expect they would fail that test.
It would be a shame to delay this fix just because it doesn't fix all
Andrew Bennetts s...@users.sourceforge.net added the comment:
FWIW, comparing the change history sections of
http://www.opengroup.org/onlinepubs/95399/functions/siginterrupt.html and
http://www.opengroup.org/onlinepubs/95399/functions/sigaction.html
suggests that sigaction predates
Changes by Andrew Bennetts s...@users.sourceforge.net:
--
nosy: +spiv
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8407
___
___
Python-bugs-list
Andrew Bennetts s...@users.sourceforge.net added the comment:
I'm not exactly sure how we will know if it is expected to fail,
though. I don't think `HAVE_SIGACTION` is exposed nicely to Python
right now.
It might be useful to have the contents of pyconfig.h exposed as a dict
somehow
New submission from Andrew Bennetts s...@users.sourceforge.net:
The effect of signal.siginterrupt(somesig, False) is reset the first time a
that signal is received. This is not the documented behaviour, and I do not
think this is a desireable behaviour. It renders siginterrupt effectively
Andrew Bennetts s...@users.sourceforge.net added the comment:
Note that a trivial untilConcludes isn't correct for select if a timeout was
passed. If a select(..., 60) was interrupted after 59 seconds, you probably
want to restart it with a timeout of 1 second, not 60
New submission from Andrew Bennetts s...@users.sourceforge.net:
Here's a demonstration of the bug:
from unittest import TestCase
class MyTest(TestCase):
... def test_foo(self): pass
...
tc = MyTest('test_foo')
import copy
copy.deepcopy(tc)
Traceback (most recent call last):
File
Changes by Andrew Bennetts s...@users.sourceforge.net:
--
nosy: +spiv
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list
New submission from Andrew Bennetts [EMAIL PROTECTED]:
http://bugs.python.org/issue1683368 changed object.__init__ so that
rejects args/kwargs. This change should be mentioned in the What's New
in Python 2.6 document, probably under the Porting to Python 2.6 heading.
(I noticed this because
25 matches
Mail list logo