-
Notifications
You must be signed in to change notification settings - Fork 6
Move library code out of inner directory #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
Comments
Turns out the import structure for IterTools is
|
Is this just import syntax confusion? The folder is the same name as one of the modules. Don't import the folder: Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit CLUE nRF52840 Express with nRF52840
>>> import adafruit_itertools
>>> dir(adafruit_itertools)
['__class__', '__name__', '__file__', '__path__']
>>> import the module: Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit CLUE nRF52840 Express with nRF52840
>>> from adafruit_itertools import adafruit_itertools
>>> dir(adafruit_itertools)
['__class__', '__name__', 'count', '__file__', '__version__', 'chain', 'compress', '__repo__', 'accumulate', 'chain_from_iterable', 'combinations', 'combinations_with_replacement', 'cycle', 'dropwhile', 'filterfalse', 'groupby', 'islice', 'permutations', 'product', 'repeat', 'starmap', 'takewhile', 'tee', 'zip_longest']
>>> EDIT: oops. nvm. looks like that's already been found. |
I believe this is basically a bug. In CPython, regular Python 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import itertools
>>> dir(itertools)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', '_grouper', '_tee', '_tee_dataobject', 'accumulate', 'chain', 'combinations', 'combinations_with_replacement', 'compress', 'count', 'cycle', 'dropwhile', 'filterfalse', 'groupby', 'islice', 'pairwise', 'permutations', 'product', 'repeat', 'starmap', 'takewhile', 'tee', 'zip_longest'] |
The inner directory should be removed. Reopening. |
As a result of a recent bugfix in CircuitPython itertools: adafruit/Adafruit_CircuitPython_IterTools#15 adafruit/Adafruit_CircuitPython_IterTools#16
From Dave Astels:
There's something wrong with the adafruit_itertools build/packaging. Using the source from GitHub works, but the dir/mpy in the bundle doesn't... it just imports empty.
Please see https://forums.adafruit.com/viewtopic.php?f=65&t=191711
From Kattni:
I tried importing
islice
using the GitHub source code, and it failed. I see it in the file, it exists, but it's not importing evidently. Dave originally included runningdir(adafruit_itertools)
from the REPL as proof that it was importing empty, but even the GitHub source code only shows['__class__', '__name__', '__file__', '__path__']
. I am unsure whether it is supposed to show more.The text was updated successfully, but these errors were encountered: