Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

Conversation

@buckbaskin
Copy link

This change was made in response to a Github Issue #140
and a question on an Adafruit forum:
https://forums.adafruit.com/viewtopic.php?f=47&t=85731&p=432043&sid=584c7d7c80739693b81e5e0112c7c104#p432043)

The error comes from this line:
https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/blob/master/Adafruit_LEDpixels/Adafruit_LEDpixels.py#L73

The error was caused by Python3 using floating point division when
Python2 would use integer division. The change uses a // instead
of / which forces both languages to use integer division.

In Python2, 10 / 3 gives 3
In Python3, 10 / 3 gives 3.333333

After the change:

In Python2, 10 // 3 gives 3
In Python3, 10 // 3 gives 3

The output of the code is now the same, regardless of Python 2 vs. 3 as tested on my interpreters (2.7.6 and 3.5.1).

The error was caused by Python3 using floating point division when
Python2 would use integer division. The change uses a // instead
of / which forces both languages to use integer division.

In Python2, 10 / 3 gives 3
In Python3, 10 / 3 gives 3.333333

After the change:

In Python2, 10 // 3 gives 3
In Python3, 10 // 3 gives 3
@ladyada
Copy link
Member

ladyada commented Sep 30, 2019

This library has been deprecated in favor of our python3 Blinka library. We have replaced all of the libraries that use this repo with CircuitPython libraries that are Python3 compatible, and support a wide variety of single board/linux computers!

Visit https://circuitpython.org/blinka for more information

CircuitPython has support for almost 200 different drivers, and a as well as FT232H support for Mac/Win/Linux!

@ladyada ladyada closed this Sep 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants