Closed biodives closed 3 years ago
I just realize that the issue may very well reside with thonny instead of pico micropython. But at least it is now documented somewhere.
Ping @aivarannamaa
This happens because mistakes at class level mess up MicroPython. @biodives and @aallan, you can help me convincing Damien that this problem is worth fixing: https://github.com/micropython/micropython/issues/7171.
The best I could do in Thonny 3.3.7, was to show a less verbose error message (https://github.com/thonny/thonny/issues/1788). I haven't pinged Simon Long about 3.3.7 yet. (I hope to release 3.3.8 in couple of days, so I think I'll save him from publishing 3.3.7.)
Thanks for looking into this. My main point of confusion was that the verbose thonny system error message distracted me from the actual triggering error message at the very start. Hopefully the root cause in micropython can be fixed but until that time a more concise thonny error message should help a lot.
I made a silly coding mistake but the error message threw me off so I hope documenting it here will help others or allow a fix to get a more informative error message. Here is the error message:
Here is some simplified code to demonstrate the issue:
self.ooops tries to assign to a property outside a method block. Once, moved into init the error message goes away.