On Sun, Jun 15, 2003, Guido van Rossum wrote:
On Sun, Jun 15, 2003, email@example.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...)
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.