Issue1512942
Created on 2006-06-26 19:47 by belopolsky, last changed 2007-03-09 03:30 by collinwinter.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
object-setattr.patch
|
belopolsky,
2006-06-26 19:47
|
Diff against svn revision 47103 |
|
|
|
msg50530 - (view) |
Author: Alexander Belopolsky (belopolsky) |
Date: 2006-06-26 19:47 |
|
Fixes Bugs item #1506776
|
|
msg50531 - (view) |
Author: Armin Rigo (arigo) |
Date: 2006-06-28 10:36 |
|
Logged In: YES
user_id=4771
The error message can still be wrong. For example, in the
following situation:
class X(object):
__slots__ = ['a']
X().b = 5
Then the original message -- no attribute 'b' -- was correct.
With this patch Python now wrongly tells you that 'X' object
has only read-only attributes.
|
|
msg50532 - (view) |
Author: Alexander Belopolsky (belopolsky) |
Date: 2006-06-29 18:07 |
|
Logged In: YES
user_id=835142
I did not think of the that case.
It looks like there is no easy way to distinguish the slots
and no slots case in PyObject_GenericSetAttr.
I think the proper fix will involve not filling tp_setattro
with PyObject_GenericSetAttr in the presence of slots, but
use a function that is optimized for that case.
Can anyone suggest a simpler fix?
|
|
msg50533 - (view) |
Author: Collin Winter (collinwinter) |
Date: 2007-03-09 03:30 |
|
Since no-one has been able to come up with a simple fix or a better error message, and since the referenced bug report was closed eight months ago, I'm closing this patch, too.
|
|
| Date |
User |
Action |
Args |
| 2006-06-26 19:47:07 | belopolsky | create | |
|