[Python-Dev] New PEP: 319
Greg Ewing
greg@cosc.canterbury.ac.nz
Tue, 17 Jun 2003 10:40:48 +1200 (NZST)
Michel Pelletier <michel@dialnetwork.com>:
> Hmm good point, integer objects are a special case, they are shared and
> are thus a bad example. Perhaps only instances should be
> synchronizable.
In the presence of new-style classes, how do you define an "instance"?
Anyway, the problem here isn't what kind of object was used, it's the
way the programmer used it (i.e. locking on an object that wasn't
going to stay around for the duration of the operation). I can't
really see a way of preventing this kind of stupidity by restricting
what types of objects can be locked -- you can lose a reference to any
type of object.
Maybe this is an argument against having implicit lock objects? If the
programmer has to explicitly create and keep track of the lock object,
he might look after it a bit more carefully.
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg@cosc.canterbury.ac.nz +--------------------------------------+