Skip to content

adafruit_itertools_extra: Fix import #4

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

Merged
merged 2 commits into from
Aug 20, 2019
Merged

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Aug 20, 2019

The import statement incorrectly referred to the package, not the submodule, leading to the reported traceback

Testing performed: the user's testcase,

>>> from adafruit_itertools.adafruit_itertools import count
>>> from adafruit_itertools.adafruit_itertools_extras import take
>>> take(1, count(1, 5))
[1]

Closes: #3

jepler added 2 commits August 20, 2019 07:37
The import statement incorrectly referred to the package,
not the submodule, leading to the reported traceback

Testing performed: the user's testcase,
```
>>> from adafruit_itertools.adafruit_itertools import count
>>> from adafruit_itertools.adafruit_itertools_extras import take
>>> take(1, count(1, 5))
[1]
```

Closes: #3
For technical reasons, pylint can't treat adafruit_itertools as a package
when analyzing it, leading to the reported diagnostic

************* Module adafruit_itertools_extras
E: 79, 0: Attempted relative import beyond top-level package (relative-beyond-top-level)

Since creating an empty __init__.py would consume 512 valuable bytes of
storage on a circuitpython device, instead just silence the message.
Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bravo!

@dhalbert dhalbert merged commit fe729f6 into adafruit:master Aug 20, 2019
@dhalbert
Copy link
Contributor

dhalbert commented Aug 20, 2019

@jepler want to make a release or shall I? Done.

@jepler
Copy link
Contributor Author

jepler commented Aug 20, 2019

@dhalbert you'll have to teach me sometime

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 20, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.1.3 from 2.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#18 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_hashlib to v1.0.1 from v1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_hashlib#2 from brentru/fix-md5-import

Updating https://github.com/adafruit/Adafruit_CircuitPython_IterTools to 1.0.1 from v1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_IterTools#4 from jepler/issue3

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_binascii, Adafruit_CircuitPython_hashlib
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

Successfully merging this pull request may close these issues.

AttributeError, adafruit_itertools dependencies not loaded by adafruit_itertools_extras
2 participants