On Wed, Dec 15, 2021 at 7:35 PM Finn Mason wrote:
> 4. Should this also be added to pathlib? I say definitely, probably in the
>> form of class constructors (e.g. Path.user_data()).
>>
>
putting it in pathlib makes a lot of sense, but I wouldn't make them a
bunch of Path classmethods -- why thot
On Wed, Dec 15, 2021, 8:32 PM Finn Mason wrote:
> It would be a good idea to add something like appdirs to the stdlib. Maybe
> something like os.path.userdata() (as an example name). I have four
> questions:
>
> 1. What should the functions be called, and module should they go in? I
> personally
It would be a good idea to add something like appdirs to the stdlib. Maybe
something like os.path.userdata() (as an example name). I have four
questions:
1. What should the functions be called, and module should they go in? I
personally say os.path module, with names such as userdata() for
On Wed, Dec 15, 2021 at 4:29 PM Christopher Barker
wrote:
> On Wed, Dec 15, 2021 at 2:57 PM Neil Girdhar
> wrote:
>
>> +1 for appdirs. It's a shame that more projects don't yet use it.
>>
>
I agree -- I've wanted something like that for years in the stdlib.
wxPython has wx.StandardPaths --
+1 for appdirs. It's a shame that more projects don't yet use it.
On Wednesday, December 15, 2021 at 9:03:07 AM UTC-5 Matt del Valle wrote:
> There is appdirs which does precisely what you're looking for:
>
> https://pypi.org/project/appdirs/
>
> That said, it does seem to be a core bit of
> On 15 Dec 2021, at 13:45, JGoutin via Python-ideas
> wrote:
>
> Hello,
>
> The idea is to add 3 functions to get "config", "data" and "cache"
> directories that are commonly used to store application files in user home /
> system.
>
> This look very straightforward to get theses
Hello,
Thanks for the suggested packages.
"platfromdirs" look to be a fork of "appdirs", both seems to support many OS
and cases. That look to be good non stdlib solutions.
The "xdg" module seem to only support Linux, but provides more dirs on it.
https://pypi.org/project/platformdirs/ is intended to cover this sort
of requirement.
Paul
On Wed, 15 Dec 2021 at 13:47, JGoutin via Python-ideas
wrote:
>
> Hello,
>
> The idea is to add 3 functions to get "config", "data" and "cache"
> directories that are commonly used to store application
There is appdirs which does precisely what you're looking for:
https://pypi.org/project/appdirs/
That said, it does seem to be a core bit of functionality that would be
nice to have in the os and pathlib modules without needing an external
dependency. I'm not going to weigh in on the pros/cons
Hi,
[xdg](https://pypi.org/project/xdg).xdg_config_home seems to give you the
parent of what you need, doesn't it?
Cheers,
E
On Wed, 15 Dec 2021 at 13:47, JGoutin via Python-ideas <
python-ideas@python.org> wrote:
> Hello,
>
> The idea is to add 3 functions to get "config", "data" and "cache"
Hello,
The idea is to add 3 functions to get "config", "data" and "cache" directories
that are commonly used to store application files in user home / system.
This look very straightforward to get theses directories path, but in practices
it depends on many factors like OS, environnement
Christopher Barker writes:
> but it is clear that the whole "are annotations only for typing"
> question will be made more clear.
Can we please stop posting this? AFAICS, the basic principle is
absolutely clear. For the foreseeable future:
1. Annotations are NOT "only for typing".
2. Uses
If you didn't know, range objects already support most non-mutating list
methods:
>>> fakelist = range(1, 101)
>>> fakelist[-1]
100
>>> fakelist[-10:]
range(91, 101)
>>> 50 in fakelist
True
>>> fakelist.index(50)
49
Range objects are more efficient than lists
13 matches
Mail list logo