New submission from Mark Dickinson <[EMAIL PROTECTED]>: In 3.0, the int and float constructors accepts bytes instances as well as strings:
>>> int(b'1') 1 >>> float(b'1') 1.0 but the complex constructor doesn't: >>> complex(b'1') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: complex() argument must be a string or a number I'd suggest that at least one of these three results is a bug, but I'm not sure which. >From a purity point of view, I think int() and float() shouldn't accept bytes. Is this a case of practicality beats purity? What are the pratical reasons to have int() and float() accept bytes? Once this is resolved, the behaviors of Decimal and Fraction should also be considered. ---------- components: Interpreter Core messages: 64494 nosy: marketdickinson severity: normal status: open title: int and float accept bytes, complex does not type: behavior versions: Python 3.0 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2483> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com