summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-01 03:12:33 (GMT)
committerGuido van Rossum <guido@python.org>1997-04-01 03:12:33 (GMT)
commitc054d70aee8080dcbb81a0231fcd416811ffe830 (patch)
tree927634b186c101874ddf557256d40eb820e02755
parent94dbd9948351d8f1ed09799eae622242b15d4cc1 (diff)
downloadcpython-c054d70aee8080dcbb81a0231fcd416811ffe830.zip
cpython-c054d70aee8080dcbb81a0231fcd416811ffe830.tar.gz
cpython-c054d70aee8080dcbb81a0231fcd416811ffe830.tar.bz2
Get rid of .conj pseudo data attribute for complex numbers.
Add __members__ attribute.
-rw-r--r--Objects/complexobject.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index b141f2f..197aa6d 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -606,11 +606,8 @@ complex_getattr(self, name)
return (object *)newfloatobject(self->cval.real);
else if (strcmp(name, "imag") == 0)
return (object *)newfloatobject(self->cval.imag);
- else if (strcmp(name, "conj") == 0) {
- cval.real = self->cval.real;
- cval.imag = -self->cval.imag;
- return (object *)newcomplexobject(cval);
- }
+ else if (strcmp(name, "__members__") == 0)
+ return mkvalue("[ss]", "imag", "real");
return findmethod(complex_methods, (object *)self, name);
}