Avoiding `from moduleX import *` statements


(Sudeep) #1

I’m not sure if this is the best place to post this, but I thought I’d post this as a bit of constructive feedback.

I just started through Week 1 of the Deep Learning course and noticed that both the Notebook as well as the Fastai library has pretty much all imports of the form from moduleX import *. In general, this is not a recommended best practice, as it makes it very hard to follow code and understand where certain “magic” functions/classes/objects come from.

At a basic level, I feel that the notebooks at least should contain explicit imports to help learners understand where different things reside and get a better mental map of the fastai library. That would help us get more comfortable with the fastai library and this feels especially important since there doesn’t seem to be much in the way of documentation for the fastai library at the moment.

It would also be really nice if the fastai library also avoided this style of imports. It makes it really hard to open up some source code and quickly get a handle on what is going on and how things are structured. I’m sure a full blown IDE might alleviate some of these issues, but given that most of use are interacting with the code in Jupyter Lab or just pulling things up on Github, explicit imports would be very helpful.

Thanks for the awesome course… I’m enjoying my experience so far and love the forums and additional resources provided for each week!