[issue14823] Simplify threading.Lock.acquire() description

2012-05-18 Thread Q

Q abon...@gmail.com added the comment:

My bad. That's indeed what I did. Won't repeat the mistake, sorry.

--

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



[issue14823] Simplify threading.Lock.acquire() description

2012-05-17 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 6ab4128a by R David Murray in branch '3.2':
#14823: Simplify threading.Lock.acquire argument discussion.
http://hg.python.org/cpython/rev/6ab4128a

New changeset b5e95bb79ba3 by R David Murray in branch 'default':
#14823: Simplify threading.Lock.acquire argument discussion.
http://hg.python.org/cpython/rev/b5e95bb79ba3

New changeset 251463919f3c by R David Murray in branch '2.7':
#14823: Simplify threading.Lock.acquire argument discussion.
http://hg.python.org/cpython/rev/251463919f3c

--
nosy: +python-dev

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



[issue14823] Simplify threading.Lock.acquire() description

2012-05-17 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Instead I decided to go ahead and document the argument as True/False.  That 
something else is accepted is a CPython implementation detail that shouldn't be 
depended on.

By the way, I couldn't actually use your patch file, since it wasn't against 
the threading.rst file from the repository.

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

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



[issue14823] Simplify threading.Lock.acquire() description

2012-05-17 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I suspect the patch was made against the source files served by Sphinx with a 
txt extension.

--
nosy: +eric.araujo

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



[issue14823] Simplify threading.Lock.acquire() description

2012-05-16 Thread Q

Q abon...@gmail.com added the comment:

Well, as threading is a Python wrapper, this could easily be fixed. (I am not 
certain whether it *should* be fixed or not -- perhaps things are fine just as 
they are, at least with that particular detail. ) 

But this is good to know, thank you.

--

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



[issue14823] Simplify threading.Lock.acquire() description

2012-05-15 Thread Q

New submission from Q abon...@gmail.com:

Hi there,

I suggest to improve the description of Lock.acquire()
[ http://docs.python.org/library/threading.html#threading.Lock.acquire ]
in the following way:

 current version 
Lock.acquire([blocking])

   Acquire a lock, blocking or non-blocking.

   When invoked without arguments, block until the lock is unlocked,
   then set it to locked, and return true.

   When invoked with the *blocking* argument set to true, do the same
   thing as when called without arguments, and return true.

   When invoked with the *blocking* argument set to false, do not
   block.  If a call without an argument would block, return false
   immediately; otherwise, do the same thing as when called without
   arguments, and return true.

 current version 


 suggested version 
Lock.acquire([blocking])

   Acquire a lock, blocking or non-blocking.

   When invoked with the *blocking* argument set to true 
   (the default), block until the lock is unlocked, 
   then set it to locked, and return true.

   When invoked with the *blocking* argument set to false, do not
   block.  If a call without an argument would block, return false
   immediately; otherwise, set the lock to locked, and return true.

 suggested version 

The idea is to simplify the structure of the explanation: get rid of an 
unnecessary goto -- do the same thing as as well as the extra branching 
(when invoked without arguments ... when invoked with *blocking* argument 
set to true) .

The suggested patch for the text version of the documentation ( 
http://docs.python.org/download.html - 
http://docs.python.org/archives/python-2.7.3-docs-text.tar.bz2 ) is attached. 

PS. I did not dare to capitalize the boolean variables (true - True) to 
adhere to the general style of the document (obviously inherited from Java). 
For the same reason I didn't either change the argument signature from 
[blocking] to [blocking=True].

--
assignee: docs@python
components: Documentation
files: threading.txt.patch
keywords: patch
messages: 160786
nosy: docs@python, thread13
priority: normal
severity: normal
status: open
title: Simplify threading.Lock.acquire() description
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file25604/threading.txt.patch

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



[issue14823] Simplify threading.Lock.acquire() description

2012-05-15 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Thanks for the suggestion and the patch.

The 'true' isn't inherited from java.  The actual value can be either an 
integer or True/False.  (If it were a function written in Python it would be 
any value that evaluates as true, but because it is written in C it is actually 
restricted to an integer...this is a bit of a wart, actually).

In the Python3 docs it is indeed documented as 'blocking=True'.  The Python2 
docs use an older signature style that we didn't bother to fix up.

--
nosy: +r.david.murray
stage:  - commit review
type:  - behavior
versions: +Python 3.2, Python 3.3 -Python 2.6

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