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

Eric Fahlgren ericfahlgren at gmail.com
Mon May 7 13:02:17 EDT 2018


On Sun, May 6, 2018 at 9:30 PM, Mike Miller <python-ideas at mgmiller.net>
wrote:

> On 2018-05-06 19:13, Nick Coghlan wrote:
>
>> Specifically, the ones I'd have in mind would be:
>>
>> - dirname (aka os.path.dirname)
>> - joinpath (aka os.path.join)
>> - abspath (aka os.path.abspath)
>>
> Yes, I end up importing those in most scripts currently.  Just "join" has
> worked fine, although I could imagine someone getting confused about it.


Our homebuilt pre-pathlib package has an 'abs_path' parameter in join, so
that could easily eliminate the abspath function itself:

>>> joinpath('.', abs_path=True)
<cwd>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180507/c748f5c9/attachment-0001.html>


More information about the Python-ideas mailing list