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 vinay.sajip
Recipients vinay.sajip, zaneb
Date 2019-09-09.14:33:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> There's no way to be sure. But if you have a public (i.e. non-underscore-prfixed) attribute then some percentage of people are going to set it, particularly if it seems to work.

Well, reading it isn't problematic, so there's no leading underscore. (The setXXX() code in logging predates Python 2 and properties).

> The code doesn't look wrong, so mistakes are going to happen.

That's true for lots of code. Sure, mistakes will happen, and that's the price paid when one doesn't follow documentation. It feels wrong to do this as a band-aid to help out people who didn't do the right thing.

> but the good news is that the values are now cached

That's not relevant to the performance numbers I posted above, is it? In that code snippet, that's a single constant value (0) that's being returned either via an attribute, or via a property.
Date User Action Args
2019-09-09 14:33:10vinay.sajipsetrecipients: + vinay.sajip, zaneb
2019-09-09 14:33:10vinay.sajipsetmessageid: <>
2019-09-09 14:33:10vinay.sajiplinkissue37857 messages
2019-09-09 14:33:09vinay.sajipcreate