Get rid of .conj pseudo data attribute for complex numbers.

Add __members__ attribute.
This commit is contained in:
Guido van Rossum 1997-04-01 03:12:33 +00:00
parent 94dbd99483
commit c054d70aee
1 changed files with 2 additions and 5 deletions

View File

@ -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);
}