[pypy-issue] [issue1454] ctypes: __int__ not called for ctype subclass

Christoph Reiter tracker at bugs.pypy.org
Mon Apr 15 19:17:08 CEST 2013


New submission from Christoph Reiter <reiter.christoph at gmail.com>:

>>>> from ctypes import c_uint
>>>> class Foo(c_uint):
....     def __int__(self):
....         return 42
.... 
>>>> int(Foo())
CPython:
42
PyPy:
ValueError: invalid literal for int() with base 10: ''

maybe related:

int(c_uint()) also fails with the same error

----------
messages: 5581
nosy: lazka, pypy-issue
priority: bug
status: unread
title: ctypes: __int__ not called for ctype subclass

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1454>
________________________________________


More information about the pypy-issue mailing list