From c054d70aee8080dcbb81a0231fcd416811ffe830 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 1 Apr 1997 03:12:33 +0000 Subject: [PATCH] Get rid of .conj pseudo data attribute for complex numbers. Add __members__ attribute. --- Objects/complexobject.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Objects/complexobject.c b/Objects/complexobject.c index b141f2fd481..197aa6db921 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); }