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-41923: PEP 613: Add TypeAlias to typing module by east825 · Pull Request #22532 · python/cpython

Conversation

@east825

@east825 east825 commented Oct 3, 2020 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.

https://bugs.python.org/issue41923

Sorry, something went wrong.

Uh oh!

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

All reactions
@east825
bpo-41923: PEP 613: Add TypeAlias to typing module
c15b706
This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.
@east825
east825 requested review from gvanrossum and ilevkivskyi as code owners October 3, 2020 22:21
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Oct 3, 2020
@bedevere-bot bedevere-bot added the awaiting review label Oct 3, 2020
gvanrossum
gvanrossum reviewed Oct 3, 2020
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2020-10-03-23-14-50.bpo-41923.Buonw9.rst Resolved

Uh oh!

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

@east825
Merge branch 'master' of github.com:python/cpython into bpo-41923_PEP…
b5a088d
…-613_typing.TypeAlias
@east825

east825 commented Oct 5, 2020

Copy link
Copy Markdown
Contributor Author

I can try to come up with proper documentation for TypeAlias in this PR or separately, especially if someone agrees to proofread me.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum

gvanrossum commented Oct 5, 2020 via email

Copy link
Copy Markdown
Member
I’d be happy to proofread!-- --Guido (mobile)
east825 reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@east825
Draft the bare-bones documentation for TypeAlias
c49533f
east825
east825 commented Oct 7, 2020
View reviewed changes

@east825 east825 left a comment

Copy link
Copy Markdown
Contributor Author

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.

Can I consider the problem with mentioning me in ACKS resolved, since I only ported my own PR in typing_extensions? I wouldn't ever have claimed someone else's authorship(

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Misc/NEWS.d/next/Library/2020-10-03-23-14-50.bpo-41923.Buonw9.rst Resolved

Uh oh!

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

@east825

east825 commented Oct 7, 2020

Copy link
Copy Markdown
Contributor Author

I've added minimal documentation, but already not sure about a couple of things:

  • Should all the examples of type aliases, first of all, those in the documentation for typing module, be updated to use TypeAlias?
  • I don't know how to better put, both in What's New and in the documentation for typing, that people are encouraged to use the new annotation, however, the former "implicit" syntax will continue to be supported by type checkers. PEP 613 doesn't give any deprecation timeline in this regard.
All reactions

Sorry, something went wrong.

Uh oh!

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

gvanrossum
gvanrossum approved these changes Oct 7, 2020
View reviewed changes

@gvanrossum gvanrossum left a comment

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.

I will apply my text nits and land. Thanks for your contribution, and welcome to the walhalla named Misc/ACKS. :-)

Sorry, something went wrong.

Uh oh!

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

east825 reacted with hooray emoji
All reactions
  • 🎉 1 reaction
Comment thread Doc/whatsnew/3.10.rst Resolved

Uh oh!

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

Comment thread Doc/whatsnew/3.10.rst Outdated
Comment on lines +106 to +107
PEP604: New Type Operator
-------------------------

@gvanrossum gvanrossum Oct 7, 2020

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.

Suggested change
PEP604: New Type Operator
-------------------------
PEP 604: New Type Union Operator
--------------------------------

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/whatsnew/3.10.rst
return number ** 2


Now, type hints can be written in a more succinct manner::

@gvanrossum gvanrossum Oct 7, 2020

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.

Suggested change
Now, type hints can be written in a more succinct manner::
Type hints can now be written in a more succinct manner::

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Misc/NEWS.d/next/Library/2020-10-03-23-14-50.bpo-41923.Buonw9.rst Resolved

Uh oh!

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

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Oct 7, 2020
@gvanrossum

gvanrossum commented Oct 7, 2020

Copy link
Copy Markdown
Member

I've added minimal documentation, but already not sure about a couple of things:

* Should all the examples of type aliases, first of all, those in the documentation for typing module, be updated to use TypeAlias?

I don't think so. Let's wait for this to be implemented in all static checkers before we go down that road.

* I don't know how to better put, both in What's New and in the documentation for typing, that people are encouraged to use the new annotation, however, the former "implicit" syntax will continue to be supported by type checkers. PEP 613 doesn't give any deprecation timeline in this regard.

I don't think deprecation is needed at this point -- some type checkers may start enforcing it but they will communicate to their own users.

All reactions

Sorry, something went wrong.

Uh oh!

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

gvanrossum
gvanrossum reviewed Oct 7, 2020
View reviewed changes
Comment thread Doc/whatsnew/3.10.rst Resolved

Uh oh!

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

@gvanrossum
Fix PEPNNN heading titles
1c2fecf
These should be PEP NNN.
@gvanrossum
gvanrossum merged commit 4f3c250 into python:master Oct 7, 2020
@bedevere-bot

bedevere-bot commented Oct 7, 2020

Copy link
Copy Markdown

@gvanrossum: Please replace # with GH- in the commit message next time. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the awaiting merge label Oct 7, 2020
@gvanrossum

gvanrossum commented Oct 7, 2020

Copy link
Copy Markdown
Member

Thanks again!

east825 reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@east825

east825 commented Oct 8, 2020

Copy link
Copy Markdown
Contributor Author

I will apply my text nits and land. Thanks for your contribution, and welcome to the walhalla named Misc/ACKS. :-)

Thanks for admitting me there!

All reactions

Sorry, something went wrong.

Uh oh!

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

@east825
east825 deleted the bpo-41923_PEP-613_typing.TypeAlias branch October 8, 2020 09:58
shihai1991 added a commit to shihai1991/cpython that referenced this pull request Oct 9, 2020
@shihai1991
Merge remote-tracking branch 'origin/master' into bpo_39337_new_2
a69eef8
* origin/master: (147 commits)
  Fix the attribute names in the docstring of GenericAlias (pythonGH-22594)
  bpo-39337: Add a test case for normalizing of codec names (pythonGH-19069)
  bpo-41557: Update Windows installer to use SQLite 3.33.0 (pythonGH-21960)
  bpo-41976: Fix the fallback to gcc of ctypes.util.find_library when using gcc>9 (pythonGH-22598)
  bpo-41306: Allow scale value to not be rounded (pythonGH-21715)
  bpo-41970: Avoid test failure in test_lib2to3 if the module is already imported (pythonGH-22595)
  bpo-41376: Fix the documentation of `site.getusersitepackages()` (pythonGH-21602)
  Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (pythonGH-6121)" (pythonGH-22584)
  bpo-41923: PEP 613: Add TypeAlias to typing module (python#22532)
  Fix comment about PyObject_IsTrue. (pythonGH-22343)
  bpo-38605: Make 'from __future__ import annotations' the default (pythonGH-20434)
  bpo-41905: Add abc.update_abstractmethods() (pythonGH-22485)
  bpo-41944: No longer call eval() on content received via HTTP in the UnicodeNames tests (pythonGH-22575)
  bpo-41944: No longer call eval() on content received via HTTP in the CJK codec tests (pythonGH-22566)
  Post 3.10.0a1
  Python 3.10.0a1
  bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (python#22505)
  bpo-41939: Fix test_site.test_license_exists_at_url() (python#22559)
  bpo-41774: Tweak new programming FAQ entry (pythonGH-22562)
  bpo-41936. Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (pythonGH-22552)
  ...
xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
@east825 @xzy3-cdc
bpo-41923: PEP 613: Add TypeAlias to typing module (python#22532)
0447400
This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gvanrossum gvanrossum gvanrossum approved these changes
@ilevkivskyi ilevkivskyi Awaiting requested review from ilevkivskyi

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

@east825 @gvanrossum @bedevere-bot @the-knights-who-say-ni
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.