[yt-dev] RFC: using only explicit imports in core yt

Matthew Turk matthewturk at gmail.com
Wed Aug 14 06:18:45 PDT 2013


I agree with Britton -- this should be done, and the laziness was mine.

The reason we currently import "from yt.mods import *" is because at
the time that was set up, it enabled us to also do sub-package imports
without getting the full API.  I'd be open to alternate proposals for
that idiom.

-Matt

On Sun, Aug 11, 2013 at 9:50 AM, Britton Smith <brittonsmith at gmail.com> wrote:
> +1
>
> I think we started doing this out of laziness and it just caught on.  It
> definitely makes more sense to go back importing just what you need.
>
>
> On Sat, Aug 10, 2013 at 2:07 AM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>>
>> +1
>>
>> It makes the code hard to approach for newcomers as well.  It definitely
>> confused me at first.
>>
>>
>> On Friday, August 9, 2013, Kacper Kowalik wrote:
>>>
>>> Hi,
>>> I'd like to discuss deprecating glob imports in yt-3.0. Initial work has
>>> been done in PR68 [1].
>>>
>>> Main rationale is that '*' confuses all python static checkers and
>>> obscures bugs that otherwise would be trivial to find.
>>>
>>> I understand that it's onerous and the very reason yt.funcs exists is to
>>> make devs' live more convenient and allow to easily grab everything
>>> that's defined there. However, using said yt.funcs as an example, it's
>>> worth noticing that there are not many modules that grab more than 2-3
>>> methods from it. That allows me to hope that in the end it won't be such
>>> a great PITA...
>>>
>>> Cheers,
>>> Kacper
>>>
>>>
>>> [1] https://bitbucket.org/yt_analysis/yt-3.0/pull-request/68/
>>>
>>
>> _______________________________________________
>> yt-dev mailing list
>> yt-dev at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>>
>
>
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>



More information about the yt-dev mailing list