3 ms·
Another thing I'd like for small projects is for "obvious" modules to be imported without having to say so. For example if I do glob.glob("*.txt") it's rather
by bemmu 6y ago
Another thing I'd like for small projects is for "obvious" modules to be imported without having to say so.
For example if I do glob.glob("*.txt") it's rather obvious that I also wanted to "import glob".
- zb1plus 6y agoI think this would be super helpful within the context of a jupyter notebook
- refactor_master 6y agoAn IDE like PyCharm should be able to suggest the import for you.
- mhh__ 6y agoD has import std; which just imports the whole standard library in one go (for writing). You might be able to write your own (not sure if python has public imports)
- makapuf 6y agoYou can check https://pypi.org/project/smart_imports/ https://pypi.org/project/smart_imports/
- fulafel 6y ago> Get source code of the module, from which smart_imports.all() has called. > Parse it, find all not initialized variables. > Search imports, suitable for found variables. Import them. Genius. (Evil genius mabye...)
- black3r 6y agoPyCharm has functionality that allows you to find the correct import in libraries across your project. If it finds multiple functions / objects with the same name, it gives you choices. For me on larger projects it shows choices ~80% of the time. I wonder how can this work correctly on anything larger than the provided example.