[issue44195] importlib.abc.TraversableReader is not implemented

2021-07-29 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset ab4da079232356e781743b2782148bc7c03f1ee3 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-44195: Use 'TraversableResources' in the docs to match the 
implementation. (GH-26317) (GH-26335)
https://github.com/python/cpython/commit/ab4da079232356e781743b2782148bc7c03f1ee3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-24 Thread miss-islington


miss-islington  added the comment:


New changeset d309bcc9e36adb2437a02550514df3efeb1b2343 by Miss Islington (bot) 
in branch '3.10':
bpo-44195: Use 'TraversableResources' in the docs to match the implementation. 
(GH-26317)
https://github.com/python/cpython/commit/d309bcc9e36adb2437a02550514df3efeb1b2343


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24927
pull_request: https://github.com/python/cpython/pull/26335

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-24 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +24926
pull_request: https://github.com/python/cpython/pull/26334

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-24 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

> are people supposed to be implementing readers with just files(), or are they 
> always expected to inherit TraversableResources?

A resource provider could potentially implement only the `files()` method (what 
I think you're calling `TraversableReader`), but my expectation was that all 
providers would provide a Reader derived from `TraversableResources` in order 
to provide backward-compatibility for the `ResourceReader` interface. Long 
term, I'd expect to deprecate all but `files()` on `TraversableResources`.

If a provider only implemented `files()` today and did not inherit from 
`TraversableResources`, they would still satisfy the `files()` API, but not the 
ResourceReader API (i.e. violate the expectation that 
`Loader.get_resource_reader` returns a ResourceReader).

I decided not to present both `TraversableReader` and `TraversableResources` as 
separate classes because the latter was sufficient for all known cases.

> It seems to me that maybe that is an issue and we actually want 
> [DegenerateFiles] to inherit from TraversableResources.

Perhaps. What advantage would that have?

> Regardless of the usefulness in code, please also consider type hinting.

Agreed, there are some places where type hints would drastically improve 
readability.

> If people are expecting to be using this protocol, we should expose it.

My instinct is `TraversableResources` is the preferred protocol for now, 
although I think it's likely we'll want to separate out the TraversableReader 
when necessary. Let's plan to do that in importlib_resources first.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-23 Thread Filipe Laíns

Filipe Laíns  added the comment:

We do implement the protocol, and not TraversableResources, in some places, 
such as DegenerateFiles for eg. It seems to me that maybe that is an issue and 
we actually want to inherit from TraversableResources.

The question here is, are people supposed to be implementing readers with just 
files(), or are they always expected to inherit TraversableResources?

Regardless of the usefulness in code, please also consider type hinting. If 
people are expecting to be using this protocol, we should expose it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I don't believe a `TraversableReader` protocol was intended. Instead, the 
referenced change introduced the `TraversableResources` ABC. There's a typo in 
the docs. I created PR 26317 instead to correct the mistake. WDYT?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-23 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +24912
pull_request: https://github.com/python/cpython/pull/26317

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-20 Thread Filipe Laíns

Change by Filipe Laíns :


--
pull_requests: +24877
pull_request: https://github.com/python/cpython/pull/26272

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-20 Thread Filipe Laíns

Change by Filipe Laíns :


--
keywords: +patch
pull_requests: +24876
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26271

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44195] importlib.abc.TraversableReader is not implemented

2021-05-20 Thread Filipe Laíns

New submission from Filipe Laíns :

7f7e706d78ab968a1221c6179dfdba714860bd12 introduced the files() api and 
documented a importlib.abc.TraversableReader protocol, but it did not implement 
it.

This class is documented and marked as introduced in 3.9, but it's actually 
missing.

--
messages: 394052
nosy: FFY00, brett.cannon, jaraco
priority: normal
severity: normal
status: open
title: importlib.abc.TraversableReader is not implemented
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com