Skip to content

Conversation

@JelleZijlstra
Copy link
Member

No description provided.

def tounicode(self) -> str: ...
if sys.version_info < (3, 9):
def fromstring(self, __buffer: bytes) -> None: ...
def fromstring(self, __buffer: str | ReadableBuffer) -> None: ...
Copy link
Member Author

Choose a reason for hiding this comment

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

proof (on 3.6):

>>> array.array("b", []).fromstring("x")
>>> array.array("b", []).fromstring(42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: a bytes-like object is required, not 'int'
>>> array.array("b", []).fromstring(b"x")
>>> 

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Lg

@github-actions
Copy link
Contributor

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

@JelleZijlstra JelleZijlstra merged commit b8659e6 into python:master Oct 28, 2022
@JelleZijlstra JelleZijlstra deleted the array branch October 28, 2022 21:20
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.

2 participants