[Python-3000] About "daemon" in threading module
Jesus Cea
jcea at jcea.es
Thu Sep 4 17:03:53 CEST 2008
-----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 Cea Avion _/_/ _/_/_/ _/_/_/
jcea at jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/
jabber / xmpp:jcea at jabber.org _/_/ _/_/ _/_/_/_/_/
. _/_/ _/_/ _/_/ _/_/ _/_/
"Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/
"My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQCVAwUBSL/415lgi5GaxT1NAQJ+ugP/RA0wG1b2/q0C96FYq18AIMGONrfKMh7+
BjxrdAL3knqwPXsJW1JbgQV5vsOLpMqx6v8epdFN9FLH5KBLTW3jDmn3OAh7FwyN
5CcoXFc8MWT4/tsa2+SUOVC1rBibx5+b2Cz28KK/RnXK6O4WR/u/3f8fpssMApdW
kC6Y0MqFoD4=
=2/g3
-----END PGP SIGNATURE-----
More information about the Python-3000
mailing list