Alex Martelli wrote:
> Queue.Queue in 2.* (and queue.Queue in 3.*) is like that too -- the
> single leading underscore meaning "protected" ("I'm here for subclasses
> to override me, only" in C++ parlance) and a great way to denote "hook
> methods" in a Template Method design pattern instance. Base class deals
> with all locking issues in e.g. 'get' (the method a client calls),
> subclass can override _get and not worry about threading (it will be
> called by parent class's get with proper locks held and locks will be
> properly released &c afterwards).
Ah, thank you - yes, that's the one I was thinking of. My brain was
telling me "threading", which makes some sense, since I put the Queue
conceptually in the same bucket as the rest of the locking constructs in
the threading module.
Cheers,
Nick.
--
Nick Coghlan | [email protected] | Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com