micropython/tests/cpydiff/types_int_subclassconv.py

12 wiersze
219 B
Python

"""
categories: Types,int
description: No int conversion for int-derived types available
cause: Unknown
workaround: Unknown
"""
class A(int):
__add__ = lambda self, other: A(int(self) + other)
a = A(42)
print(a+a)