adafruit / Adafruit_CircuitPython_TCA9548A

CircuitPython driver for the TCA9548A I2C Multiplexer.
MIT License
26 stars 14 forks source link

Remove obsolete code (Fixes #20) #23

Closed SAK917 closed 3 years ago

SAK917 commented 3 years ago

Address change requested in Issue #20 by making the following changes:

Refactor writeto_then_readfrom() to be consistent with the other methods in the class by now returning self_tca_i2c.writeto_then_readfrom()

Remove obsolete code in writeto_then_readfrom() as per @jepler in Issue #20

_I did test the changes to the extent I could (i.e., no errors at runtime and able to instantiate an adafruittca9548a.TCA9548A object in code), but I do not have a TCA9548A board to physically test.

SAK917 commented 3 years ago

I saw that this Issue was flagged as a Good First Issue that nobody had tackled yet and thought I would try to help out. Please don't hold back on suggestions or best practices, I am trying to learn!

ladyada commented 3 years ago

looks good! i dont think we need the return tho :)

SAK917 commented 3 years ago

Thanks @ladyada, and sorry if I am missing something but if you look at all the code in this module, the other methods in this class (e.g., writeto(), unlock(), etc.) return the associated method. Is there something unique with this method that I modified that makes it different from the others? I am happy to remove the return if it is unneeded, but I just wanted to double check.

ladyada commented 3 years ago

imma defer to @tannewt on stylistic decision on whether to return. i feel like the original code did not return so replacement shouldnt?

SAK917 commented 3 years ago

I am happy to defer to whatever you and @tannewt feel is correct. Just let me know and I will make the changes and push to the PR.