New submission from Serhiy Storchaka: According to the discussion on Python-Dev [1] alternate constructors should return an instance of the subclass (else why invoke it through the subclass). bytes.fromhex() and bytearray.fromhex() are the only exceptions.
I think bytes.fromhex() and bytearray.fromhex() should be changed to match the behavior of all other alternate constructors. [1] http://comments.gmane.org/gmane.comp.python.devel/157649 ---------- components: Interpreter Core messages: 265375 nosy: georg.brandl, serhiy.storchaka priority: normal severity: normal status: open title: Alternate constructors bytes.fromhex() and bytearray.fromhex() return an instance of base type type: enhancement versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27007> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com