48ffd6596e
To be consistent with MP_UNARY_OP_INT_FLOAT and MP_UNARY_OP_INT_COMPLEX, and allow int() to first check if a type supports __int__ before trying other things (as per CPython). Signed-off-by: Damien George <damien@micropython.org>
9 lines
124 B
Python
9 lines
124 B
Python
# Test class special methods, that use a bigint.
|
|
|
|
class A:
|
|
def __int__(self):
|
|
return 1 << 100
|
|
|
|
|
|
print(int(A()))
|