diff -r 867034806ace Cython/Compiler/ExprNodes.py
--- a/Cython/Compiler/ExprNodes.py	Fri May 23 22:32:33 2008 +0200
+++ b/Cython/Compiler/ExprNodes.py	Sun May 25 02:13:26 2008 -0300
@@ -989,6 +989,11 @@ class NameNode(AtomicExprNode):
                         namespace,
                         self.interned_cname,
                         rhs.py_result()))
+                typeptr_cname = entry.scope.parent_type.typeptr_cname
+                code.putln("#if PY_VERSION_HEX >= 0x02060000")
+                code.putln("(%s)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;" %
+                           typeptr_cname)
+                code.putln("#endif")
             else: 
                 code.put_error_if_neg(self.pos,
                     'PyObject_SetAttr(%s, %s, %s)' % (
