Replies: 2 comments 1 reply
-
This is not currently supported, although it would be possible to support it. This is typically the case with MicroPython/Pybricks. In this case, there are already 2 valid ways to do it, so we did not feel compelled to add a 3rd way to do it, to save space. But likewise, if it turns out that people ask about those features, we can certainly consider adding them. |
Beta Was this translation helpful? Give feedback.
-
Is it a lot of effort to support the "as" keyword? The first 2 ways create a lot of clutter in the code:
for each class usage: The 3rd way is allowed by the IDE but not by the linter when I want to add a script to the repo: thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
I want to import all the classes in pybricks.pupdevices
I do not want have a huge list cluttering my file though.
"from pybricks.pupdevices import *" works but the linter complains that it does not know where the imported classes come from.
Normally in python I would be able to:
"import module.submodule as short" and have a short name reference to the library.
When I do this in pybricks I get:
AttributeError: 'module' object has no attribute 'pupdevices'
So how can I fix this?
PS: I even tried a weird structure like "from pybricks.pupdevices import * as pupdev"
Beta Was this translation helpful? Give feedback.
All reactions