On Thu, Jan 9, 2014 at 5:20 AM, Florian Lindner <mailingli...@xgm.de> wrote: > def norm_path(*parts): > """ Returns the normalized, absolute, expanded and joined path, assembled > of all parts. """ > parts = [ str(p) for p in parts ] > return os.path.abspath(os.path.expanduser(os.path.join(*parts)))
Apologies for responding to something that's not the point of your post, but I see this as a job for map, rather than a list comp: def norm_path(*parts): """ Returns the normalized, absolute, expanded and joined path, assembled of all parts. """ path = os.path.join(*map(str,parts)) return os.path.abspath(os.path.expanduser(path)) (or completely onelinered, since you don't seem to mind longish lines). ChrisA -- https://mail.python.org/mailman/listinfo/python-list