micropython/tests/cpydiff/types_float_implicit_conver...

15 wiersze
314 B
Python

"""
categories: Types,float
description: uPy allows implicit conversion of objects in maths operations while CPython does not.
cause: Unknown
workaround: Objects should be wrapped in ``float(obj)`` for compatibility with CPython.
"""
class Test:
def __float__(self):
return 0.5
print(2.0 * Test())