Re: [libgpiod][PATCH 01/22] bindings: python: clean up imports and exports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 27, 2024 at 9:05 PM Vincent Fazio <vfazio@xxxxxxxxxxx> wrote:
>
> Remove unused imports and sort the remainder following isort rules.
>
> Update submodules to use lists for `__all__` for ease of re-exporting
> public classes from within gpiod.
>
> Also, fix instances where `line` wasn't imported via a relative import.
> The library now consistently uses relative imports for submodules.
>
> Signed-off-by: Vincent Fazio <vfazio@xxxxxxxxxxx>
> ---

This definitely improves the output of help(gpiod) but I was under the
impression that we discussed re-exporting the definitions from
gpiod.line directly from gpiod and I argued that this isn't really a
good idea as they do fall under the umbrella of "line" definitions and
should be imported from gpiod.line explicitly. I thought it would work
more like:

>>> from gpiod import *
# now we also imported line
>>> line.Direction.OUTPUT
<Direction.OUTPUT: 3>

Is there any reason for not doing it this way?

Bart





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux