Repository navigation
Implement a low-level interface for loaders to implement instead of TraversableResources - #183
Conversation
|
In GitLab by @gregory.szorc on Apr 5, 2020, 11:48 Commented on importlib_resources/abc.py line 125 I assume instances are created via a sibling method to |
|
In GitLab by @gregory.szorc on Apr 5, 2020, 11:48 Commented on importlib_resources/abc.py line 144 What does virtual mean here? Must the child packages also be actual Python packages or can any e.g. child directory be returned, even if it doesn't have a Python package / |
|
In GitLab by @gregory.szorc on Apr 5, 2020, 11:48 Commented on importlib_resources/abc.py line 161 Nit: I'd prefer a name like |
|
In GitLab by @gregory.szorc on Apr 5, 2020, 11:50 I only really looked at the interface as it pertains to the |
|
In GitLab by @gregory.szorc on Apr 5, 2020, 11:51 Commented on importlib_resources/abc.py line 151 What are the rules for resources in child sub-directories? Can returned resources have e.g. |
|
In GitLab by @gregory.szorc on Apr 5, 2020, 11:51 Commented on importlib_resources/abc.py line 158 Is |
|
In GitLab by @brettcannon on Apr 6, 2020, 13:21 Commented on importlib_resources/abc.py line 125 Would it be worth making this a protocol instead of an ABC? |
|
In GitLab by @jaraco on Apr 11, 2020, 11:36 Commented on importlib_resources/abc.py line 125
I was imagining that
I'm not familiar with protocols, so I'd be ill-suited to make a value judgment or advise on best practices. I just read up on protocols (PEP 544) and the idea seems sound, but it's not obvious to me what the implications would be. I'm not sure what it means for a |
|
In GitLab by @jaraco on Apr 11, 2020, 11:39 Commented on importlib_resources/abc.py line 144 I used this language from your prototype. What I mean here is any container of resources. I'll adjust the wording to be explicit. |
|
In GitLab by @jaraco on Apr 11, 2020, 11:41 Commented on importlib_resources/abc.py line 144 Updated in 09786d6. |
|
In GitLab by @jaraco on Apr 11, 2020, 11:51 Commented on importlib_resources/abc.py line 161 Acknowledged. My motivation here is twofold:
I'm not sure either of these motivations are relevant here. I need to think about this approach some more. |
|
In GitLab by @jaraco on Apr 11, 2020, 11:55 Commented on importlib_resources/abc.py line 151 I'm disinclined to provide any constraints unless I know those constraints add value. Too frequently, I see interfaces over-constrain in order to simplify the implementation around a specific use-case and inadvertently disallow future legitimate use-cases. It should be a Unicode string, but otherwise, I don't see any reason to constrain the names. If the underlying container can support |
|
In GitLab by @jaraco on Apr 11, 2020, 11:57 Commented on importlib_resources/abc.py line 158 It's up to the implementation to accept/reject specific values. Same reasoning as with |
|
In GitLab by @jaraco on Apr 11, 2020, 15:08 added 1 commit
|
|
In GitLab by @brettcannon on Apr 14, 2020, 15:33 Commented on importlib_resources/abc.py line 125
IOW if someone types something as accepting |
|
In GitLab by @jaraco on Apr 16, 2020, 17:07 Commented on importlib_resources/abc.py line 125 That's helpful. I'll experiment with Protocols. My instinct is that making |
|
In GitLab by @jaraco on Apr 16, 2020, 17:07 unmarked as a Work In Progress |
|
In GitLab by @jaraco on Apr 16, 2020, 17:08 @gregory.szorc I'm planning to merge this change as proposed. How likely is it you will be able to prototype a PyOxidizer branch against this branch to validate the behavior? |
4f07f7c to
f9ab26d
Compare
…s based on other abstract methods.
…to simply 'children'.
…der between ResourceHandle and ResourceContainer.
a4e5b12 to
f60d050
Compare
In GitLab by @jaraco on Mar 24, 2020, 11:36
As discussed in #90, this MR attempts to implemented the proposed interface for loaders to supply more basic functionality for loading resources.