diff options
| author | Michael W. Hudson <mwh@python.net> | 2002-02-22 13:23:33 +0000 |
|---|---|---|
| committer | Michael W. Hudson <mwh@python.net> | 2002-02-22 13:23:33 +0000 |
| commit | 03474c5c5da180a91391b2284f77089eb976f580 (patch) | |
| tree | 6bc09c72da414fad65b60b764cbe67f5f0e11304 | |
| parent | 35bbe5666781d52ceb4c3190bfb35328b76a9952 (diff) | |
| download | cpython-git-03474c5c5da180a91391b2284f77089eb976f580.tar.gz | |
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!
| -rw-r--r-- | Objects/complexobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 1ee1c546e5..0bc388b896 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -629,9 +629,9 @@ static PyMethodDef complex_methods[] = { }; 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}, }; |
