-
Notifications
You must be signed in to change notification settings - Fork 8
Replaced asserts with exceptions #15
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
Replaced asserts with exceptions #15
Conversation
Updating a README change
getting even again with adafruits lead repo
According to Issue adafruit#10 of the main repo, exceptions shall be used instead of asserts. I'm game.
Looks like Travis is failing on a few pylint things. Can you check them a push a new commit with fixes. |
Travis was lazy last night (my time) and after 15 minutes or so I gave up. Let's see if he likes my changes now. |
did some pylint beautifications
Travis being picky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and Travis is passing now, however I don't have the hardware to test this.
adafruit_tlc5947.py
Outdated
@@ -104,7 +104,8 @@ def duty_cycle(self): | |||
|
|||
@duty_cycle.setter | |||
def duty_cycle(self, val): | |||
assert 0 <= val <= 65535 | |||
if (val < 0) or (val > 65535): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ()
s. The "pythonic" syntax is:
if val < 0 or val > 65535:
Same for all other conditionals.
adafruit_tlc5947.py
Outdated
@@ -128,6 +129,8 @@ def frequency(self, val): | |||
|
|||
|
|||
def __init__(self, spi, latch, *, auto_write=True, num_drivers=1): | |||
if num_drivers < 1: | |||
raise ValueError("need at least one driver; {0} is not supported.".format(num_drivers)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize first word in message.
Need at least...
Same for all messages.
Thanks for putting this back on the radar. I've got a few stylistic change requests. |
No problem. Now that you pointed those out, I agree. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC5947 to 1.2.2 from 1.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_TLC5947#15 from ArthurDent62/ArthurDent62-exceptionNotAssert Updating https://github.com/adafruit/Adafruit_CircuitPython_TinyLoRa to 1.0.8 from 1.0.7: > Merge pull request adafruit/Adafruit_CircuitPython_TinyLoRa#20 from jerryneedell/jerryn_big_packet
According to issue #10