Skip to content

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

Merged

Conversation

ArthurDent62
Copy link
Contributor

According to issue #10

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.
@caternuson
Copy link
Contributor

Looks like Travis is failing on a few pylint things. Can you check them a push a new commit with fixes.

@ArthurDent62
Copy link
Contributor Author

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.
Copy link
Collaborator

@makermelissa makermelissa left a 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.

@@ -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):
Copy link
Contributor

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.

@@ -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))
Copy link
Contributor

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.

@caternuson
Copy link
Contributor

Thanks for putting this back on the radar. I've got a few stylistic change requests.

@makermelissa
Copy link
Collaborator

No problem. Now that you pointed those out, I agree.

@caternuson caternuson merged commit 43f6c80 into adafruit:master Feb 11, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 11, 2019
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
@ArthurDent62 ArthurDent62 deleted the ArthurDent62-exceptionNotAssert branch February 12, 2019 00:06
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.

3 participants