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 — Move Protocol, runtime_checkable, Final, final, Literal, and TypedDict to typing by ilevkivskyi · Pull Request #649 · python/typing

Conversation

@ilevkivskyi

@ilevkivskyi ilevkivskyi commented Jun 17, 2019 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Fixes #648

This essentially just moves a bunch of code and tests from Python 2 version of typing_extensions to Python 2 version of typing. We don't need to copy the definitions in the former, and can just re-export them from typing, since there is not built-in typing module on Python 2, so that we can always assume the latest version of typing (we will just need to release them in right order, typing first, and then update dependency in typing_extensions).

Notable changes apart from the code move:

  • Like on Python 3, keep runtime in typing_extensions as an alias for runtime_checkable for backwards compatibility (the former is not included in __all__)
  • Update GenericMeta.__new__ and GenericMeta.__getitem__ instead of almost identical overrides in _ProtocolMeta.

Sorry, something went wrong.

Uh oh!

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

All reactions
ilevkivskyi added 6 commits June 17, 2019 01:36
@ilevkivskyi
Move Final from typing_extensions
66956fc
@ilevkivskyi
Move Literal from typing_extensions
7e3c442
@ilevkivskyi
Fix Literal repr tests
b28dd50
@ilevkivskyi
Move also TypedDict
bd411d5
@ilevkivskyi
Move also Protocol & co
6ab2057
@ilevkivskyi
Add missing __all__ items
19b5499
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jun 17, 2019
ilevkivskyi added 3 commits June 17, 2019 02:31
@ilevkivskyi
Fix TypedDict class name (note unicode_literals)
0d69c75
@ilevkivskyi
Update/fix tests
863a590
@ilevkivskyi
Remove now unused imports
b0aba51
@ilevkivskyi
ilevkivskyi requested a review from gvanrossum June 17, 2019 02:16
@ilevkivskyi
Try fixing Travis
21f3f11
@gvanrossum

gvanrossum commented Jun 17, 2019

Copy link
Copy Markdown
Member

Where's the dependency on a version of typing.py specified in typing_extensions?

All reactions

Sorry, something went wrong.

Uh oh!

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

@ilevkivskyi

ilevkivskyi commented Jun 17, 2019

Copy link
Copy Markdown
Member Author

Where's the dependency on a version of typing.py specified in typing_extensions?

In typing_extensions/setup.py.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ilevkivskyi

ilevkivskyi commented Jun 17, 2019

Copy link
Copy Markdown
Member Author
install_requires = []
if sys.version_info < (3, 5):
    install_requires.append('typing >= 3.6.2')
gvanrossum reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

gvanrossum
gvanrossum approved these changes Jun 17, 2019
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.

Skimmed, LG.

Sorry, something went wrong.

Uh oh!

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

All reactions
@ilevkivskyi
ilevkivskyi merged commit 537a104 into python:master Jun 17, 2019
@ilevkivskyi
ilevkivskyi deleted the move-python-2 branch June 17, 2019 16:32
@ilevkivskyi ilevkivskyi mentioned this pull request Jun 18, 2019
Protocols #417
Closed
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

Uh oh!

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

Assignees

No one assigned

Labels

CLA signed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add Protocol, runtime_checkable, Final, final, Literal, and TypedDict to typing on Python 2

Uh oh!

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

3 participants

@ilevkivskyi @gvanrossum @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.