On Thu, Nov 2, 2017 at 7:17 AM, Stefan Ram <r...@zedat.fu-berlin.de> wrote: > Wolfgang Maier <wolfgang.ma...@biologie.uni-freiburg.de> writes: >>If you're worried bout having things on separate lines, you could write: >>import os; os.getcwd() >>,etc., which is actually saving a few characters :) > > Yes, but there still is the risk of the identifier »os« > already being used in the sorrounding code. While > > __import__( "os" ).getcwd() > > does not seem to "leak" names into the enclosing scope.
If you're using the name "os" for something else, you need to be aware of that anyway. Leaking names of core modules shouldn't normally be a problem. ChrisA -- https://mail.python.org/mailman/listinfo/python-list