This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Andras.Szalai
Recipients Andras.Szalai, vinay.sajip
Date 2012-12-13.09:05:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1355389555.66.0.953536673114.issue16671@psf.upfronthosting.co.za>
In-reply-to
Content
What mislead me is:

The current code uses `is` and opposed to `==` which I assume is for the very specific reason to match identity and not value.

The sentinel starts with a _, which to a casual reader (me) suggests that it's a private implementation detail that I should not have to touch. (am I right on this?)

http://plumberjack.blogspot.co.uk/2010/09/improved-queuehandler-queuelistener.html

In the introduction of this very same class you are also mentioning that:

"... QueueListener is not even especially logging-specific: You can pass it as a handler any object that has a handle method which takes a single argument, and that method will be passed any non-sentinel object which appears on the queue."

also

"You should be able to paste QueueHandler and QueueListener into your own code..."

So suddenly logging in not the only documented use case.

And yes, I can override the sentinel in my subclass, yet it is named as `_sentinel`, which again suggests "do not touch" to me.

It's a tiny inconsistency that may never come up again for anyone else, but I just used a copy of the class and it came up for me. My tests caught it, I fixed it up for my own use-case, case closed.

So honestly it's not the end of the world, but neither is changing it to a safer default, like `{}` or even `self`.

I won't be bothering you with this issue anymore, so feel free to close it if you want.
History
Date User Action Args
2012-12-13 09:05:55Andras.Szalaisetrecipients: + Andras.Szalai, vinay.sajip
2012-12-13 09:05:55Andras.Szalaisetmessageid: <1355389555.66.0.953536673114.issue16671@psf.upfronthosting.co.za>
2012-12-13 09:05:55Andras.Szalailinkissue16671 messages
2012-12-13 09:05:54Andras.Szalaicreate