8000 Fix Backwards Logic of 'wait_for_response' In #3005 by sommersoft · Pull Request #3006 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Fix Backwards Logic of 'wait_for_response' In #3005 #3006

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

Merged
merged 1 commit into from
Jun 6, 2020

Conversation

sommersoft
Copy link

@sommersoft sommersoft requested a review from jepler June 4, 2020 03:01
Copy link
@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this "approve" so that you can merge if you're not worried about the nit I picked.

@@ -127,7 +127,7 @@ def reset(self):
self.write(b"\r" + REPL.CHAR_CTRL_B) # enter or reset friendly repl
data = self.read_until(b">>> ")

def execute(self, code, timeout=10, wait_for_response=False):
def execute(self, code, timeout=10, wait_for_response=True):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. It might be a bit better to def execute(self, code, timeout=10, *, wait_for_response=True): so that any old code that called execute(code, timeout, True) intending to get async behvior will be a runtime error, instead of turning into a call with wait_for_response=True. If the only users are in the circuitpython source tree, though, this scarcely matters.

Copy link
Author
@sommersoft sommersoft Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very excellent point, and I don't consider it a nit-pick at all.

I don't expect many people are using this. I point to it as an example how to interact with boards via a PC, but that's about it.

A lot of the semantics are so that it remains py2/py3 compatible, from what I understand (its base is MicroPython's tools/pyboard.py). I'll likely give it more scrubs for a multitude of reasons. One of those scrubs will include removing Python2 use; not worth using at this point.

@sommersoft
Copy link
Author

I'm actually going to go ahead and merge this. No reason to leave it open, as I won't get to removing Python2 support for while.

@sommersoft sommersoft merged commit 6ff7e25 into adafruit:master Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0