Commit 5bfa36db authored by Marius Wachtler's avatar Marius Wachtler

fix attrwrapper.pop and float.imag

parent 3d315a58
...@@ -1122,7 +1122,7 @@ static Box* floatConjugate(Box* b, void*) { ...@@ -1122,7 +1122,7 @@ static Box* floatConjugate(Box* b, void*) {
raiseExcHelper(TypeError, "descriptor 'conjugate' requires a 'float' object but received a '%s'", raiseExcHelper(TypeError, "descriptor 'conjugate' requires a 'float' object but received a '%s'",
getTypeName(b)); getTypeName(b));
if (b->cls == float_cls) { if (b->cls == float_cls) {
return b; return incref(b);
} else { } else {
assert(PyFloat_Check(b)); assert(PyFloat_Check(b));
return boxFloat(static_cast<BoxedFloat*>(b)->d); return boxFloat(static_cast<BoxedFloat*>(b)->d);
......
...@@ -2425,8 +2425,9 @@ public: ...@@ -2425,8 +2425,9 @@ public:
Box* r = self->b->getattr(key); Box* r = self->b->getattr(key);
if (r) { if (r) {
Py_INCREF(r);
self->b->delattr(key, NULL); self->b->delattr(key, NULL);
return incref(r); return r;
} else { } else {
if (default_) if (default_)
return incref(default_); return incref(default_);
......
...@@ -69,6 +69,7 @@ print (0.5).as_integer_ratio() ...@@ -69,6 +69,7 @@ print (0.5).as_integer_ratio()
print (0.5).is_integer() print (0.5).is_integer()
print (1.0).is_integer() print (1.0).is_integer()
print 1.0.__hash__(), 1.1.__hash__(), -1.1.__hash__() print 1.0.__hash__(), 1.1.__hash__(), -1.1.__hash__()
print (0.5).conjugate(), (0.6).imag
print 1.0 ** (10 ** 100) print 1.0 ** (10 ** 100)
print (-1.0) ** (10 ** 100) print (-1.0) ** (10 ** 100)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment