[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-16 Thread Chris Angelico
On Tue, 17 May 2022 at 08:00, Greg Ewing wrote: > > On 17/05/22 4:58 am, Christopher Barker wrote: > > if you want to call your collection of files a single resource, then > > sure -- but then it's not the directory that's the resource, it's the > > collection of files that's the resource > >

[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-16 Thread Greg Ewing
On 17/05/22 4:58 am, Christopher Barker wrote: if you want to call your collection of files a single resource, then sure -- but then it's not the directory that's the resource, it's the collection of files that's the resource Sure, but why am I not allowed to use the name of the directory as

[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-16 Thread Christopher Barker
On Mon, May 16, 2022 at 7:38 AM Greg Werbin wrote: > Non-"binary" resources are already in widespread use, I didn't write the docs -- but a text file is, indeed a binary blob -- it only becomes text when it is read and decoded, so there is no distinction at this level. I *think* the idea

[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-16 Thread Christopher Barker
On Sun, May 15, 2022 at 11:57 PM Greg Ewing wrote: > On 16/05/22 5:05 pm, Christopher Barker wrote: > > a directory is not a binary artifact -- it can't have actually data in > > it like a file can. > > and: > > > the entire > > point of resources is to provide an abstraction -- the individual >

[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-16 Thread Greg Werbin
Non-"binary" resources are already in widespread use, so perhaps that requirement shouldn't be in the docs at all. In practice, a resource is "any data file other than a Python source file." Moreover, I see no reason why a resource name in general shouldn't be allowed to contain a "/"

[Python-ideas] Re: `importlib.resources` access whole directories as resources

2022-05-16 Thread Greg Ewing
On 16/05/22 5:05 pm, Christopher Barker wrote: a directory is not a binary artifact -- it can't have actually data in it like a file can. and: the entire point of resources is to provide an abstraction -- the individual resources may not be files on disk at all These two statements are