adafruit/Adafruit_CircuitPython_AVRprog

AVRprog.init Could Be More Pythonic

sommersoft opened this issue · 2 comments

As I started to transfer the documentation to the new setup (Issue #566), I noticed that pylint was complaining about init not having a docstring (I moved the previous docstring up a level). Since this isn't a normal pylint complaint, I noticed that init isn't a "private" function.

I noticed in the examples that this is setup for use like this:

avrprog = adafruit_avrprog.AVRprog()
avrprog.init(spi, board.D5)

The norm would be to have init as a private function (__init__), and use it like this:

avrprog = adafruit_avrprog.AVRprog(spi, board.D5)

Before I just went ahead and unilaterally changed the code and examples, I wanted to make sure that this wasn't done for a particular reason.

Here is how I currently have the documentation (to illustrate my docstring moves): https://github.com/sommersoft/Adafruit_CircuitPython_AVRprog/blob/new_docs/adafruit_avrprog.py

If there is a reason, just go ahead and close this issue and I can work out the pylint issue. Otherwise, I can go ahead and update everything during my documentation update.

hi init() is different than most init()'s because it actually resets/initiates programming of a chip. which you may want to do multiple times. so it was separated out on purpose :)

Sounds good to me! I figured there was a reason. I'll get the docstrings aligned. Thanks!