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 amaury.forgeotdarc
Recipients amaury.forgeotdarc, christian.heimes, georg.brandl, ntoronto, rhettinger
Date 2008-01-16.23:50:18
SpamBayes Score 0.0063911104
Marked as misclassified No
Message-id <1200527420.82.0.00937239809078.issue1568@psf.upfronthosting.co.za>
In-reply-to
Content
I tried patch python30-attrcache-1.diff (after reverting the changes
made to the 2.6 branch).

But test_descr fails. The cache update does not handle the case when an
attribute is unmasked, as shown in the following code:

class A: pass
class B(A): pass
b=B()
A.x = 1
assert b.x == A.x
B.x = 2
assert b.x == B.x
del B.x
b.x         # <== AttributeError: 'B' object has no attribute 'x'

(b.x should be A.x, of course)
In debug build, a C assert() stops the program
    assert(ep->value == _PyType_LookupInternal(type, name));
which suggest that the cache is out of sync.

Then I enabled 
    #define ATTRCACHE_SETATTR_INVALIDATES
to try the other possibility suggested by Neil. This version seems to
work correctly. 
I'm currently running the test suite...

Question: why is this patch different from the 2.6 version? Does it take
advantage of some 3.0 feature?
History
Date User Action Args
2008-01-16 23:50:21amaury.forgeotdarcsetspambayes_score: 0.00639111 -> 0.0063911104
recipients: + amaury.forgeotdarc, georg.brandl, rhettinger, christian.heimes, ntoronto
2008-01-16 23:50:20amaury.forgeotdarcsetspambayes_score: 0.00639111 -> 0.00639111
messageid: <1200527420.82.0.00937239809078.issue1568@psf.upfronthosting.co.za>
2008-01-16 23:50:19amaury.forgeotdarclinkissue1568 messages
2008-01-16 23:50:18amaury.forgeotdarccreate