[Python-3000] About "daemon" in threading module
Jesse Noller
jnoller at gmail.com
Thu Sep 4 17:33:51 CEST 2008
On Thu, Sep 4, 2008 at 11:03 AM, Jesus Cea <jcea at jcea.es> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> First we had "thread.setDaemon()". This was not PEP8, so Python 3.0
> renamed it to "thread.set_daemon()". Lately Python 3.0 changes the
> method to an attribute "thread.daemon".
>
> I think the last change is risky, because you can mistype and create a
> new attribute, instead of set daemon mode. Since daemon mode is only
> usually visible when things goes wrong (the main thread dies), you can
> miss the bug for a long time.
>
> Similarly with the new "thread.name" attribute.
>
> I would rather revert to the method style, or redo the class to avoid
> new attribute creation, maybe via some "thread.__setattr__()" magic.
>
> Sorry if this issue is already discussed. I don't find any previous
> thread about this.
>
> PS: If you mistype the method name, you get an error. If you mistype the
> attribute assignment, the bug goes unnoticed.
>
Jesus -
The discussion and implementation happened here:
http://bugs.python.org/issue3352
and:
http://mail.python.org/pipermail/python-dev/2008-June/080285.html
-Jesse
More information about the Python-3000
mailing list