On Thu, Sep 24, 2020 at 07:17:47PM -0300, Beraldo Leal wrote: > On Thu, Sep 24, 2020 at 03:25:50PM -0400, Cleber Rosa wrote: > > On Wed, Sep 23, 2020 at 01:12:09PM -0400, John Snow wrote: > > > On 9/23/20 9:18 AM, Cleber Rosa wrote: > > > > Relative imports are a source of heated debates, but when properly > > > > used in a self contained module like here, they are very posititive > > > > IMO. > > > > > > Still? I know they were loathed pre-3.5, but in my subjective experience > > > they behave the nicest overall in the modern python dialect. > > > > > > What are the downsides? > > > > > > --js > > > > I'll just invite Beraldo to the discussion and let the fun begin :). > > Nice try, Cleber! ;) >
C'mon... I was hoping for nothing less than an emacs .vs. vi kind of discussion. > Well, relative imports are supported by Guido, so I'm not here to say > different. There are some use-cases. > > I'm not fully aware of the qapi context and big picture here, but I > guess that depends on how you would like to use your package/scripts. > > Some may say that one "downside" is that relative imports are not as > readable as absolute ones. But reading the 04/38 PATH description by > jsnow, yes, looks like using relative imports is one valid option here. > > I prefer to use my scripts as packages inside venvs, and I use to have a > setup.py, with absolute imports whenever possible, and when in > development mode, make use of `python3 setup.py develop` which will > create the "links" for me. > Now seriously, these are good point, thanks. John, I invited Beraldo to give his take on the subject here because he started this issue on Avocado land: https://github.com/avocado-framework/avocado/issues/3525 So far on Avocado we've kept the relative imports on most places. We do have some occurences of "triple upper level" imports that don't look very nice IMO though: https://github.com/avocado-framework/avocado/blob/master/avocado/utils/software_manager/backends/rpm.py#L5 > -- > Beraldo > Anyway, I think we're all in agreement with the approach taken here. - Cleber.
signature.asc
Description: PGP signature