Code: Select all
>>> def test(a: str)->bool:
... print(a)
... return True
I could not find any information about it.
Code: Select all
>>> def test(a: str)->bool:
... print(a)
... return True
Code: Select all
micropython -v -v my_file.py
Code: Select all
$ ./micropython -v
MicroPython v1.9.4-683-gd94aa57 on 2018-11-13; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>>
My point was to check whether the bytecode was identical with or without annotations.kevinkk525 wrote: ↑Thu Dec 20, 2018 2:05 pmGuess that's a good way for firmware size but not for speed and RAM (RAM can be tested on the microcontroller of course and speed too).
However I can't find the executable "micropython". Did you mean using mpy-cross to compile it to bytecode .mpy and compare the filesize of these?
Code: Select all
def foo(a: int, b: int, c: int) -> int:
return a*b*c
print(foo(4,5,6))
Code: Select all
>>> def foo(x: int = 5):
... print(x)
...
>>> foo()
5
>>> dir(foo)
['__class__', '__name__']
>>>