Andrew Bennetts 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
<http://bugs.python.org/issue7
New submission from Andrew Bennetts :
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
>&g
Changes by Andrew Bennetts :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue9729>
___
___
Python-bugs-list mailing list
Unsubscri
Andrew Bennetts 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 of incorrect arguments
Andrew Bennetts added the comment:
> Yes, but such a rearchitecting to the socket module is out of question
> for 2.x, which is in bugfix mode.
Yes of course, which is why I made the conservative fix instead :)
--
___
Python tracker
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&
New submission from Andrew Bennetts :
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
useless at providing the
Andrew Bennetts 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.
The SocketServer_eintr.diff patch has this
Andrew Bennetts 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 an button
Andrew Bennetts 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
platforms... is it possib
Andrew Bennetts 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 :
--
nosy: +spiv
___
Python tracker
<http://bugs.python.org/issue8407>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andrew Bennetts 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 :
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 timeit -s "s = set(
Andrew Bennetts 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
Andrew Bennetts 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. On my laptop
Changes by Andrew Bennetts :
Added file: http://bugs.python.org/file17306/set-mem.py
___
Python tracker
<http://bugs.python.org/issue8685>
___
___
Python-bugs-list mailin
Andrew Bennetts 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 (and possibly would be a full
c
Changes by Andrew Bennetts :
--
nosy: +spiv
___
Python tracker
<http://bugs.python.org/issue4753>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 of
New submission from Andrew Bennetts :
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(
Andrew Bennetts added the comment:
Antoine: Thanks for the updated benchmark results! I should have done that
myself earlier.
--
___
Python tracker
<http://bugs.python.org/issue8
Andrew Bennetts 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_
Andrew Bennetts 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 to
review. It
Andrew Bennetts 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)
sock_b.close()
f
Andrew Bennetts 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
patches, my patch will
26 matches
Mail list logo