GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Attempt to clarify the ByteString situation by hauntsaninja · Pull Request #9783 · python/typeshed

Conversation

@hauntsaninja

@hauntsaninja hauntsaninja commented Feb 20, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

See python/cpython#102092

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
hauntsaninja added 3 commits February 20, 2023 14:41
@hauntsaninja
Attempt to clarify the ByteString situation
4ad291f
See python/cpython#102092

This makes the behaviour of typing.ByteString better match its
documentation.

I also remove collections.abc.ByteString. There is no legitimate use
case for it. Let me know if you think there's a case where it would help
users to have this around.
@hauntsaninja
.
24fd3c0
@hauntsaninja
add back collections abc ..... for now .........
4dcbddc
@github-actions

This comment has been minimized.

Sign in to view
@hauntsaninja
.
2ec5f71
@github-actions

This comment has been minimized.

Sign in to view
hauntsaninja added 3 commits February 20, 2023 15:47
@hauntsaninja
allowlist
3a16bd6
@hauntsaninja
allowlist
ab33068
@hauntsaninja
comment
12b8bb5
@hauntsaninja
hauntsaninja marked this pull request as draft February 20, 2023 23:50
@github-actions

This comment has been minimized.

Sign in to view
@hauntsaninja hauntsaninja mentioned this pull request Feb 21, 2023
collections.abc.ByteString is not equivalent to typing.ByteString python/cpython#102092
Closed
@srittau

srittau commented Feb 21, 2023

Copy link
Copy Markdown
Collaborator

+1 at least for removing the subclass dependency to match runtime. (Even if the abc is registered at runtime.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood
Fix flake8
ee57021
@github-actions

This comment has been minimized.

Sign in to view
hauntsaninja
hauntsaninja commented May 8, 2023
View reviewed changes
Comment thread tests/stubtest_allowlists/py3_common.txt Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hauntsaninja
Update tests/stubtest_allowlists/py3_common.txt
2217fff
@github-actions

This comment has been minimized.

Sign in to view
AlexWaygood
AlexWaygood approved these changes May 8, 2023
View reviewed changes
AlexWaygood
AlexWaygood approved these changes May 8, 2023
View reviewed changes
AlexWaygood
AlexWaygood approved these changes May 8, 2023
View reviewed changes
@AlexWaygood

AlexWaygood commented May 8, 2023

Copy link
Copy Markdown
Member

For the record, I only clicked "approve" once; not sure how that happened!

Akuli and JelleZijlstra reacted with laugh emoji
All reactions
  • 😄 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra
JelleZijlstra reviewed May 8, 2023
View reviewed changes
Comment thread stdlib/typing.pyi
def __enter__(self) -> TextIO: ...

class ByteString(Sequence[int], metaclass=ABCMeta): ...
ByteString: typing_extensions.TypeAlias = bytes | bytearray | memoryview

@JelleZijlstra JelleZijlstra May 8, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We discussed this in person a bit. "bytes | bytearray | memoryview" matches the documented semantics of this symbol (https://docs.python.org/3.11/library/typing.html#typing.ByteString), but the previous stubs here in typeshed didn't include memoryview, which is not a Sequence. It's a mess either way and that's why we deprecated this thing, but we may have to adjust this definition if people complain about it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
JelleZijlstra
JelleZijlstra approved these changes May 8, 2023
View reviewed changes
@JelleZijlstra
Merge branch 'main' into byte-string
ddb9997
@JelleZijlstra

JelleZijlstra commented May 28, 2023

Copy link
Copy Markdown
Member

This still marked as draft, @hauntsaninja shall we land it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented May 28, 2023

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hauntsaninja
hauntsaninja marked this pull request as ready for review May 28, 2023 04:36
@hauntsaninja
hauntsaninja merged commit d6a85e2 into python:main May 28, 2023
@hauntsaninja
hauntsaninja deleted the byte-string branch May 28, 2023 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes
@AlexWaygood AlexWaygood AlexWaygood approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hauntsaninja @srittau @AlexWaygood @JelleZijlstra
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.