[New-bugs-announce] [issue27007] Alternate constructors bytes.fromhex() and bytearray.fromhex() return an instance of base type

Serhiy Storchaka report at bugs.python.org
Thu May 12 04:03:19 EDT 2016


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 <report at bugs.python.org>
<http://bugs.python.org/issue27007>
_______________________________________


More information about the New-bugs-announce mailing list