New issue 1964: pypy3: bytes() prefers __int__ over __bytes__
https://bitbucket.org/pypy/pypy/issue/1964/pypy3-bytes-prefers-__int__-over-__bytes__

Christoph Reiter:

```
#!python

class Foo(object):

    def __int__(self):
        return 0

    def __bytes__(self):
        return str(0).encode("utf-8")

assert bytes(Foo()) == b"0"  # returns b"" on pypy3
```



_______________________________________________
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to