[issue26984] int() can return not exact int instance

2016-08-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue26984] int() can return not exact int instance

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 81f229262921 by Serhiy Storchaka in branch 'default': Issue #26984: int() now always returns an instance of exact int. https://hg.python.org/cpython/rev/81f229262921 -- nosy: +python-dev ___ Python

[issue26984] int() can return not exact int instance

2016-08-21 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: mark.dickinson -> serhiy.storchaka stage: patch review -> commit review ___ Python tracker

[issue26984] int() can return not exact int instance

2016-08-21 Thread Mark Dickinson
Mark Dickinson added the comment: The patch LGTM. I'm still in two minds about whether `__trunc__` should be required to return a strict `int`, but for now it's probably better to go with the status quo. -- ___ Python tracker

[issue26984] int() can return not exact int instance

2016-08-18 Thread Mark Dickinson
Mark Dickinson added the comment: > Could you please make a review Mark? Sorry, Serhiy. I missed this. I've got some time off coming up, so I plan to look at this in the next few days. -- ___ Python tracker

[issue26984] int() can return not exact int instance

2016-08-18 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson ___ Python tracker ___ ___

[issue26984] int() can return not exact int instance

2016-07-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please make a review Mark? -- ___ Python tracker ___ ___

[issue26984] int() can return not exact int instance

2016-07-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes int() always returning exact int. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file43600/int_exact.patch ___ Python tracker

[issue26984] int() can return not exact int instance

2016-05-09 Thread Mark Dickinson
Mark Dickinson added the comment: > But I think that the int constructor should convert its result to exact int. Agreed. See also issue 17576 and previous discussions on python-dev (thread started in March, but most of the messages in April): -

[issue26984] int() can return not exact int instance

2016-05-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The int constructor can return an instance of int subclass. >>> class BadTrunc: ... def __trunc__(self): ... return True ... >>> int(BadTrunc()) True When __int__ returns non-exact int, at least a warning is emitted: >>> class BadInt: ...