I have
from x import * and from x import name1, name2 all through my code.It hasn't actually bitten me yet, but I know that I need to change this. Everywhere.
In some languages, there would be no better way. This kind of import is the way things work, and if there's an ambiguity, it's a compile time issue, where things need to be made explicit/qualified when names are used, or it simply won't work.
There's a similar thing in Ada, where
with x; is essentially the same as import x, but everything must be qualified. There's a use x; statement that exposes everything in x. It's not dangerous, like Python's *, but it does make it a bastard to find things. The first rule of Ada was "Never use use".Note to self: next time I try a new language and something looks like a
use, figure out how to not use that 'feature'.
No comments:
Post a Comment