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 — bpo-46480: rephrase typing.assert_type docs by hauntsaninja · Pull Request #32069 · python/cpython

Conversation

@hauntsaninja

@hauntsaninja hauntsaninja commented Mar 23, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

The goal here is to reduce potential confusion between
assert_type(val, typ) and assert isinstance(val, typ).

The former is meant to ask a type checker to confirm a fact, the latter
is meant to tell a type checker a fact. The behaviour of the latter more
closely resembles what I'd expect from the previous phrasing of
"assert [something] to the type checker".

https://bugs.python.org/issue46480

Sorry, something went wrong.

Uh oh!

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

All reactions
hauntsaninja
bpo-46480: rephrase typing.assert_type docs
4936b0d
The goal here is to reduce potential confusion between
`assert_type(val, type)` and `assert isinstance(val, typ)`.

The former is meant to ask a type checker to confirm a fact, the latter
is meant to tell a type checker a fact. The behaviour of the latter more
closely resembles what I'd expect from the prior phrasing of
"assert [something] to the type checker".
@hauntsaninja
hauntsaninja requested review from Fidget-Spinner, JelleZijlstra and gvanrossum as code owners March 23, 2022 06:19
@bedevere-bot bedevere-bot added the awaiting review label Mar 23, 2022
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Mar 23, 2022
@hauntsaninja

hauntsaninja commented Mar 23, 2022

Copy link
Copy Markdown
Contributor Author

(We can skip-news, since this is just docs for a new feature. This was originally brought up at python/typing#1103 )

All reactions

Sorry, something went wrong.

Uh oh!

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

AlexWaygood
AlexWaygood approved these changes Mar 23, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Mar 23, 2022
@AlexWaygood AlexWaygood added the skip news label Mar 23, 2022
JelleZijlstra
JelleZijlstra approved these changes Mar 24, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Mar 24, 2022
@JelleZijlstra
JelleZijlstra merged commit 3354245 into python:main Mar 24, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Mar 24, 2022
@hauntsaninja
hauntsaninja deleted the typeassert branch March 24, 2022 02:30
hauntsaninja added a commit to hauntsaninja/cpython that referenced this pull request Apr 29, 2022
@hauntsaninja
Rephrase typing.assert_never docs
189456d
This change is similar to that in python#32069
@hauntsaninja hauntsaninja mentioned this pull request Apr 29, 2022
Rephrase typing.assert_never docs #92061
Merged
JelleZijlstra pushed a commit that referenced this pull request Apr 30, 2022
@hauntsaninja
Rephrase typing.assert_never docs (#92061)
2f7952c
This change is similar to that in #32069
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
@gvanrossum gvanrossum Awaiting requested review from gvanrossum
@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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.

5 participants

@hauntsaninja @JelleZijlstra @AlexWaygood @the-knights-who-say-ni @bedevere-bot
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 01402520 — 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.