Skip to content

Conversation

vinicius507
Copy link
Contributor

Changes return type for Reader.__iter__() from bytes to Iterator[bytes].

Related Issues:

This comment has been minimized.

Copy link
Collaborator

@Akuli Akuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I ran this in mypy playground to verify that this PR fixes the issue:

from typing import Iterator, Protocol, BinaryIO

class Reader(Protocol):
    def __iter__(self) -> Iterator[bytes]: ...
    def read(self, size: int, /) -> bytes: ...
    def tell(self) -> int: ...

x: BinaryIO
y: Reader = x

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Akuli Akuli merged commit 128d8eb into python:main Jul 22, 2024
@vinicius507 vinicius507 deleted the fix/exifreader-reader branch July 22, 2024 19:35
max-muoto pushed a commit to max-muoto/typeshed that referenced this pull request Jul 23, 2024
max-muoto pushed a commit to max-muoto/typeshed that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid stubs for ExifRead process_file
3 participants