[issue17309] __bytes__ doesn't work in subclass of int

Paul Koning report at bugs.python.org
Wed Feb 27 16:41:26 CET 2013


New submission from Paul Koning:

The __bytes__ special method has no effect in a subclass of "int" because the bytes() builtin checks for int or int subclass before it gets around to looking for that special method.  The attached example shows it.

----------
components: Interpreter Core
files: bytes.py
messages: 183155
nosy: pkoning
priority: normal
severity: normal
status: open
title: __bytes__ doesn't work in subclass of int
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file29264/bytes.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17309>
_______________________________________


More information about the Python-bugs-list mailing list