Re: [Python-Dev] Unique loader per module

2018-01-22 Thread Nick Coghlan
On 21 January 2018 at 01:56, Barry Warsaw wrote: > On Jan 05, 2018, at 05:12 PM, Nick Coghlan wrote: > >>I think the main reason you're seeing a problem here is because >>ResourceReader has currently been designed to be implemented directly >>by loaders, rather than being a subcomponent that you c

Re: [Python-Dev] Unique loader per module

2018-01-20 Thread Barry Warsaw
On Jan 05, 2018, at 05:12 PM, Nick Coghlan wrote: >I think the main reason you're seeing a problem here is because >ResourceReader has currently been designed to be implemented directly >by loaders, rather than being a subcomponent that you can request >*from* a loader. > >If you instead had an in

Re: [Python-Dev] Unique loader per module

2018-01-05 Thread Brett Cannon
Barry and I had a meeting at work today and we decided to go with Nick's idea of using a get_resource_reader(fullname) method on loaders. We aren't going to go with an ABC and simply depend on the method existing as implementing the API (and then returning None if the loader can't handle the specif

Re: [Python-Dev] Unique loader per module

2018-01-04 Thread Nick Coghlan
On 3 January 2018 at 06:35, Barry Warsaw wrote: > Brett doesn’t like this, for several reasons (quoting): > > 1. redundant API in all cases where the loader is unique to the module > 2. the memory savings of sharing a loader is small > 3. it's implementation complexity/overhead for an optimization

[Python-Dev] Unique loader per module

2018-01-02 Thread Barry Warsaw
We have what I think is one last design question for importlib.resources. https://gitlab.com/python-devs/importlib_resources/issues/49 The problem is that the ResourceReader ABC omits the package from the function signatures, so that on a compatible loader, you only need to specify the resource