[Python-Dev] New PEP: 319

Aahz aahz@pythoncraft.com
Mon, 16 Jun 2003 00:08:53 -0400


On Sun, Jun 15, 2003, Guido van Rossum wrote:
> [Aahz]
>> On Sun, Jun 15, 2003, michel@dialnetwork.com wrote:
>>> 
>>> After doing a whole heck of a lot of Java and Jython programming over
>>> the last year I decided to work an idea of mine into a PEP after being
>>> impressed with Java thread syncronization and frustrated with Python
>>> (it's almost always the other way around...)
>>>
>>> http://www.python.org/peps/pep-0319.html
>> 
>> You need to be *much* clearer about the proposed interface between the
>> ``synchronize`` keyword and Python objects.
> 
> I agree with Aahz; especially the scope of the lock used by an
> anonymous synchronize block is ambiguous in the current PEP.  In one
> example it appears that there is a lock associated with each
> unqualified use of the synchronize keyword; in another, it seems that
> unqualified uses in the same class share a lock.
> 
> Please try to explain the semantics of named and unnamed synchronize
> calls entirely in terms of code that would work in current Python,
> without using English (other than "this code is equivalent to that
> code").

It occurs to me that my comment was actually insufficiently clear: what
I mean by "interface" is, "What methods get called on which Python
objects?"  In particular, read closely the documentation on such things
as iterators (and the way they work with ``for`` loops) and the
sequence/mapping protocol.
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra