[Python-ideas] proposal: os.path.joinuser()

Tarek Ziadé tarek at ziade.org
Tue Sep 23 14:32:24 CEST 2014


Le 23/09/14 09:52, Giampaolo Rodola' a écrit :
>
>
> On Tue, Sep 23, 2014 at 9:19 AM, Tarek Ziadé <tarek at ziade.org
> <mailto:tarek at ziade.org>> wrote:
>
>     Hello
>
>     I realize I am using a lot this pattern:
>
>        >>> os.path.join(os.path.expanduser('~'), 'something', 'here')
>        '/Users/tarek/something/here'
>
>
>     It's quite complicated, and not really intuitive.
>
>
> I don't find that complicated, just a bit verbose perhaps, but it's
> definitively clear what it's doing and it is also explicit.
~ is a Unix notion I think,  and since expanduser() works under Windows,
I don't think it's that intuitive and explicit.

Unless we'd change it so we omit "~" =>

e.g. os.path.expanduser()   and os.path.expanduser('specificuser')

Cheers
Tarek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140923/f033d447/attachment.html>


More information about the Python-ideas mailing list