[issue14087] multiprocessing.Condition.wait_for missing

2012-04-17 Thread Charles-François Natali

Charles-François Natali  added the comment:

Committed.
Thanks for the patch, and sorry for the delay!

--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-04-17 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 5606ee052783 by Charles-François Natali in branch 'default':
Issue #14087: multiprocessing: add Condition.wait_for(). Patch by sbt.
http://hg.python.org/cpython/rev/5606ee052783

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-04-17 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Charles-François, will you take this one? :)

Yes :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-04-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Charles-François, will you take this one? :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-04-16 Thread sbt

sbt  added the comment:

New patch which calculates endtime outside loop.

--
Added file: http://bugs.python.org/file25240/cond_wait_for.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-04-07 Thread sbt

sbt  added the comment:

New patch skips tests if ctypes not available.

--
Added file: http://bugs.python.org/file25155/cond_wait_for.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-03-31 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

AFAICT (Raw)Value relies on ctypes, so the tests should be skipped if ctypes is 
unavailable. Or I guess you could use a Semaphore instead.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-03-26 Thread Charles-François Natali

Changes by Charles-François Natali :


--
nosy: +pitrou
stage:  -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-02-24 Thread sbt

sbt  added the comment:

> Shouldn't the `for` loop be outside the outer `with` block?

Yes.

> In Lib/multiprocessing/managers.py:
> Is there a good reason why the wait_for() proxy method can't simply be
> implemented as:
> return self._callmethod('wait_for', (predicate, timeout))?
> 
> (There may be, I just didn't check).

That would only work if predicate is picklable, which is unlikely to be the 
case.  (The lambda functions used in the unit tests are not picklable.)

> Finally, the documentation should be updated 
> (Doc/library/multiprocessing.rst).

Fixed in new patch.

> Otherwise, it would probably be better if you could submit a contributor 
> agreement (and also maybe update your name on the tracker), unless that's
> a problem for you?

I will try to submit it over the weekend.

--
Added file: http://bugs.python.org/file24626/cond_wait_for.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-02-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

In test/test_multiprocessing.py:
"""
   def test_waitfor(self):
   [...]
   with cond:
   result = cond.wait_for(lambda : state.value==0)
   self.assertTrue(result)
   self.assertEqual(state.value, 0)
   for i in range(4):
   time.sleep(0.01)
   with cond:
   state.value += 1
   cond.notify()
"""

Shouldn't the `for` loop be outside the outer `with` block?

In Lib/multiprocessing/managers.py:
Is there a good reason why the wait_for() proxy method can't simply be 
implemented as:
return self._callmethod('wait_for', (predicate, timeout))?

(There may be, I just didn't check).

Finally, the documentation should be updated (Doc/library/multiprocessing.rst).

Otherwise, it would probably be better if you could submit a contributor 
agreement (and also maybe update your name on the tracker), unless that's a 
problem for you?

--
nosy: +neologix

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-02-23 Thread sbt

sbt  added the comment:

Patch which just copies the implementation from threading.

--
keywords: +patch
Added file: http://bugs.python.org/file24611/cond_wait_for.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14087] multiprocessing.Condition.wait_for missing

2012-02-22 Thread sbt

New submission from sbt :

multiprocessing.Condition is missing a counterpart for the wait_for() method 
added to threading.Condition in Python 3.2.

I will work on a patch.

--
components: Library (Lib)
messages: 153956
nosy: sbt
priority: normal
severity: normal
status: open
title: multiprocessing.Condition.wait_for missing
type: enhancement
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com