diff Objects/complexobject.c @ 21993:4e996314f8fb 2.2

backport gvanrossum's checkin of revision 2.54 of complexobject.c Declare real and imag as read-only attributes. This fixes SF bug #514858 (Gregory Smith): complex not entirely immutable 2.2.1 Bugfix candidate!
author Michael W. Hudson <mwh@python.net>
date Fri, 22 Feb 2002 13:23:33 +0000
parents 33d59e18b68d
children 75ef1f16725e
line wrap: on
line diff
--- a/Objects/complexobject.c	Fri Feb 22 13:22:55 2002 +0000
+++ b/Objects/complexobject.c	Fri Feb 22 13:23:33 2002 +0000
@@ -629,9 +629,9 @@
 };
 
 static PyMemberDef complex_members[] = {
-	{"real", T_DOUBLE, offsetof(PyComplexObject, cval.real), 0,
+	{"real", T_DOUBLE, offsetof(PyComplexObject, cval.real), READONLY,
 	 "the real part of a complex number"},
-	{"imag", T_DOUBLE, offsetof(PyComplexObject, cval.imag), 0,
+	{"imag", T_DOUBLE, offsetof(PyComplexObject, cval.imag), READONLY,
 	 "the imaginary part of a complex number"},
 	{0},
 };