On Sun, 13 Feb 2022 at 21:47, Paul Moore <p.f.mo...@gmail.com> wrote:
>
> On Sun, 13 Feb 2022 at 01:09, Steven D'Aprano <st...@pearwood.info> wrote:
>
> > I'm sorry Paul, but this sort of made-up, utterly artificial toy example
> > adds no benefit to the discussion, it just adds fear, uncertainty and
> > doubt to an extremely straight-forward feature request.
>
> OK, if that's your view then fine. I agree the example was made up,
> although I dispute "utterly artificial", as it reflects a genuine
> concern I have, it's just not one that I can find or construct a
> non-artificial example for right now. But yes, the example wasn't
> good.

Finding a non-artificial example would be important here, given that
there are plenty of non-artificial examples to the contrary (cases
where env vars are used for arbitrary parts of paths, not being
restricted to path components).

If there is some incredibly rare situation where that functionality is
needed, it can be coded directly in the application.

> Let's keep it simple. I'm -1 on the request, I don't think expandvars
> should be added to pathlib. I think os.path isn't a very good place
> for it currently, but it's what we have. I'm not massively
> enthusiastic about it being in shlex, but I can't think of a better
> place for it. So I'm inclined to stick with the status quo, or if it's
> *really* worth doing anything, move it to shlex.
>

It could also go into os (alongside environ itself).

I'm +0.5 on paths getting a method for variable expansion, +0.5 for
os.path.expandvars learning to return a Path if given a Path (it
already returns bytes or str based on the input). Either would work.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/TXQS7EXGLTTCTV64YJVGREUVK56LJK2R/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to