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.

classification
Title: fix for pychecker property complaints
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: benjamin.peterson, christian.heimes, georg.brandl, nnorwitz, pitrou, skip.montanaro
Priority: normal Keywords: easy, needs review, patch

Created on 2008-08-24 13:10 by skip.montanaro, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pychecker.diff skip.montanaro, 2008-08-24 13:10
Messages (8)
msg71836 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2008-08-24 13:10
Attached is a patch to fix some pychecker complaints Neal Norwitz
uncovered.  All involved tests pass.  Submitting patch simply because
we're past beta3.
msg71837 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-08-24 14:18
It doubt many people are inheriting from the classes that are changed to
new-style in the patch, but I thought it was policy that we didn't
change that until 3.0 "just in case".
msg71838 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2008-08-24 15:21
I can see where that might be a problem.  If that's the case I suspect 
those property attributes should be changed.  OTOH, do properties work on 
classic classes?
msg71840 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-08-24 16:11
Read-only properties on old-style classes seem to work (though I don't
know if that is an implementation accident), insofar it seems harmless
not to apply this patch.
msg71841 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-08-24 16:13
No, they don't work correctly. Readonly properties in old style classes
aren't readonly:

>>> class Example:
...     @property
...     def spam(self):
...         return "spam"
...
>>> example = Example()
>>> example.spam
'spam'
>>> example.spam = "egg"
>>> example.spam
'egg'
msg71842 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-08-24 16:15
Ah yes. But still, I'd call that harmless. Assigning to attributes
you're not supposed to assign to is detrimental in many cases.
msg72397 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-09-03 16:59
If it's only to please pychecker, then I don't think we should make this
change. It's potential gratuitous breakage, especially if people
subclass those classes.
msg72989 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-09-10 21:58
I agree with Antoine, so I'm just going to close this as rejected.
There's little benefit in it, but there is potential harm.
History
Date User Action Args
2022-04-11 14:56:38adminsetgithub: 47908
2008-09-10 21:58:43benjamin.petersonsetstatus: open -> closed
resolution: rejected
messages: + msg72989
2008-09-03 16:59:57pitrousetnosy: + pitrou
messages: + msg72397
2008-08-24 16:15:41georg.brandlsetmessages: + msg71842
2008-08-24 16:13:58christian.heimessetnosy: + christian.heimes
messages: + msg71841
2008-08-24 16:11:54georg.brandlsetnosy: + georg.brandl
messages: + msg71840
2008-08-24 15:21:47skip.montanarosetmessages: + msg71838
2008-08-24 14:18:26benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg71837
2008-08-24 13:10:28skip.montanarocreate