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

Todd toddrjen at gmail.com
Tue Sep 23 14:51:04 CEST 2014


On Tue, Sep 23, 2014 at 2:37 PM, Tarek Ziadé <tarek at ziade.org> wrote:

> Le 23/09/14 14:32, Tarek Ziadé a écrit :
> [...]
> > ~ 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')
> I would even say that the api name "expanduser" is redundant with the
> fact that you absolutely need to pass a '~' as a first char
> if you want it to do something at all.
>
> The more I think about it, the more I find it unintuitive
>
>
>
What about something like os.path.homedir or os.homedir?  You could use,
for example, homedir() to get the home directory of the current user, and
homedir('username') to get the home directory of a given user (if that is
possible).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140923/9e5bf72a/attachment.html>


More information about the Python-ideas mailing list