Stefan Krah added the comment:

> PyDec_CheckExact(type) always return 0. Should be PyDec_CheckExact(result).

'result' is always an exact decimal, because your enum example won't work 
otherwise.


> And what about other calls of PyDecType_FromFloatExact()? Can they produce 
> broken instance of Decimal subtype?

The PyDecType* functions handle calling the correct allocator, they don't 
handle calling __new__().  Why should they? The regular non-class-method enum 
examples worked.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27006>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to