2 ms·
_single_leading_underscore: weak “internal use” indicator. E.g. from M import * does not import objects whose names start with an underscore. - https://peps.pyt
by Supermancho 3y ago
_single_leading_underscore: weak “internal use” indicator. E.g. from M import * does not import objects whose names start with an underscore. - https://peps.python.org/pep-0008/ https://peps.python.org/pep-0008/
Ironically, there's a story on the frontpage of HN right now, regarding attribute handling in python, which may be of interest: https://lwn.net/SubscriberLink/943619/eaa8a4496fcba1fd/ https://lwn.net/SubscriberLink/943619/eaa8a4496fcba1fd/
- BerislavLopac 3y agoYour first point is something I mentioned in my comment (although admittedly I mixed the order of the command). In general it's a bad idea to import everything from a module into the global namespace; it's recommended to keep it under some namespace for context: I.e., assuming my_module has function foo, instead of: from my_module import * foo() Use this: import my_module my_module.foo() Or this: import my_module as mm mm.foo()