[Python-ideas] __dir__ in which folder is this py file

Serhiy Storchaka storchaka at gmail.com
Mon May 7 11:15:59 EDT 2018


07.05.18 17:42, Eric Snow пише:
> I'm not necessarily saying we should add ModuleSpec.dirname(), but it
> (or something like it) is what I'd advocate for *if* we were to add a
> convenient shortcut to the directory a module is in.  FWIW, I'd
> probably use it.

The question is *why* you need the absolute path to the directory the 
module is in? Taking into account the availability of 
importlib.resources etc.



More information about the Python-ideas mailing list