-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pushing items into an empty stack on micropyhton esp32 #6
Comments
As a quick fix i added this try ... except ... in pysm.py:
|
Hi Raphael, Good finding! Thanks! The quick fix you're suggesting is silencing the exception but it doesn't fix the problem with The Python documentation states that If maxlen is not specified or is None, deques may grow to an arbitrary length. Therefore, the fix should read something like this:
So for a quick fix you can try the above. In fact I've created a branch with a fix for this bug here with some unit tests but I haven't had a chance to test it on a ESP32 yet. |
With the latest change on branch Issue-6-Pushing-items-into-an-empty-stack-on-micropyhton-esp32 (see the diff) I got the test_rpn.py working with MicroPython v1.10-230-ge0c6dfe90 on 2019-03-22; linux version. |
Thanks a lot for the updates. I just tested test_rpn.py with the updated pysm.py on the esp32 hardware and everything works without a problem now. Also I just wanted to say thanks again for the great project! |
Raphael, Thanks again for raising this issue and submitting a proposed solution. I fixed the bug and tested it against the following Micropython versions:
I published a new release - 0.3.8-alpha so you can easily use upip to install the fixed version. P. |
Hi,
thanks alot for the effort you put into this great library. It's really awesome you made it available for micropython!
I think there might be a small problem with the way items are added to an empty stack on micropython (esp32):
If i try to make the rpn_calculator.py example work on my esp32 i run into the following problem:
The problem is that:
self.sm.stack.push(int(digit))
in rpn_calculator.py tries to push into an empty stack, initialized like this:
maxlen
ends up as NoneType and therefore can't be compared with>
in the append() function in the class deque_maxlen:And in the rpn_calculator.py file there is a typo i think it should be calculate() and not caluculate()
The text was updated successfully, but these errors were encountered: