Skip to content
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

Support bytes also? #24

Closed
caternuson opened this issue Feb 19, 2021 · 1 comment
Closed

Support bytes also? #24

caternuson opened this issue Feb 19, 2021 · 1 comment

Comments

@caternuson
Copy link
Contributor

caternuson commented Feb 19, 2021

For ref:
https://forums.adafruit.com/viewtopic.php?f=60&t=175648

Seems like this could be supported? Not seeing anything requiring mutability on the FRAM write. And tuples are allowed.

This would allow for doing something like:

>>> message = "Python is fun"
>>> bytes_encoded = message.encode()
>>> fram[0] = bytes_encoded
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/adafruit_fram.py", line 174, in __setitem__
    "Data must be a single integer, or a bytearray," " list, or tuple."
ValueError: Data must be a single integer, or a bytearray, list, or tuple.
>>>

since encode returns a bytes.

@caternuson
Copy link
Contributor Author

Closing. Added with #25.

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

No branches or pull requests

1 participant