Serhiy Storchaka added the comment:

Discussion on Python-Dev: 
http://comments.gmane.org/gmane.comp.python.devel/157649 .

The conclusion is that alternate constructors should return an instance of the 
subclass, and either call constructor or use pickling machinery for creating an 
object in correct state.

Pushed the fix for int.from_bytes() and tests. I'll open separate issues for 
other alternate constructors (for example issue27006 -- for 
Decimal.from_float()).

Yes, there is similar bug in date.replace(). C implementation doesn't match 
Python implementation and bypasses the constructor. Please open separate issue 
for this Eugene.

----------
assignee:  -> serhiy.storchaka
components: +Interpreter Core -Library (Lib)
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.6 -Python 3.4

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

Reply via email to