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 — gh-119180: Documentation for PEP 649 and 749 by JelleZijlstra · Pull Request #122235 · python/cpython

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented Jul 24, 2024 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Implement PEP 649 and PEP 749 #119180

📚 Documentation preview 📚: https://cpython-previews--122235.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
JelleZijlstra added 6 commits July 23, 2024 21:21
@JelleZijlstra
pythongh-119180: Documentation for PEP 649/749
20dcb62
@JelleZijlstra
Document evaluate_forward_ref
206560c
@JelleZijlstra
Merge remote-tracking branch 'upstream/main' into pep649-doc
edd12a2
@JelleZijlstra
add something
79ce456
@JelleZijlstra
docs for annotationlib
3f70c21
@JelleZijlstra
Update inspect
e297349
@JelleZijlstra
JelleZijlstra requested a review from AlexWaygood as a code owner July 24, 2024 14:29
@bedevere-app bedevere-app Bot mentioned this pull request Jul 24, 2024
Implement PEP 649 and PEP 749 #119180
Closed
21 of 30 tasks
@bedevere-app bedevere-app Bot added the awaiting core review label Jul 24, 2024
picnixz
picnixz reviewed Jul 24, 2024
View reviewed changes

@picnixz picnixz 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.

Haven't look at everything nor had I marked every typo but here's a first round of comments.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/reference/datamodel.rst Resolved

Uh oh!

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

Comment thread Doc/reference/datamodel.rst Resolved

Uh oh!

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

JelleZijlstra and others added 4 commits July 27, 2024 09:17
@JelleZijlstra @picnixz
Apply suggestions from code review
d52fb08
Co-authored-by: Bénédikt Tran <[email protected]>
@JelleZijlstra
Merge remote-tracking branch 'upstream/main' into pep649-doc
4e7a2a5
@JelleZijlstra
More feedback
35312e7
@JelleZijlstra
Docs expansion
b30abbd
@JelleZijlstra JelleZijlstra added the skip news label Jul 27, 2024
@AA-Turner AA-Turner added the docs Documentation in the Doc dir label Jul 27, 2024
JelleZijlstra added 2 commits July 27, 2024 11:24
@JelleZijlstra
formatting
bcb6a9f
@JelleZijlstra
Merge remote-tracking branch 'upstream/main' into pep649-doc
c82fb66
AA-Turner
AA-Turner reviewed Jul 27, 2024
View reviewed changes

@AA-Turner AA-Turner 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.

Looks good, left a few comments.

General points -- the line lengths in the new text seem a bit long. Also, I wonder if it is worth covering / providing call-outs to the interactions with the annotations future? I imagine that will be something many readers will be thinking about.

A

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/glossary.rst Resolved

Uh oh!

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

Comment thread Doc/library/__future__.rst
Comment on lines 119 to +122
``from __future__ import annotations`` was previously scheduled to
become mandatory in Python 3.10, but the Python Steering Council
twice decided to delay the change
(`announcement for Python 3.10 <https://mail.python.org/archives/list/[email protected]/message/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/>`__;
`announcement for Python 3.11 <https://mail.python.org/archives/list/[email protected]/message/VIZEBX5EYMSYIJNDBF6DMUMZOCWHARSO/>`__).
No final decision has been made yet. See also :pep:`563` and :pep:`649`.
become mandatory in Python 3.10, but the change was delayed and ultimately
canceled. This feature will eventually be deprecated and removed. See
:pep:`649` and :pep:`749`.

@AA-Turner AA-Turner Jul 27, 2024

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.

Should we provide or link to migration guidance here, especially given that this is the first time a __future__ won't become the actual future?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Outdated
Comment on lines +17 to +18
The :mod:`!annotationlib` module provides tools for introspecting :term:`annotations <annotation>`
on modules, classes, and functions.

@AA-Turner AA-Turner Jul 27, 2024

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.

Potentially this could be added later, but I think a longer narrative summary of annotationlib and where it fits in could be of use -- we jump straight into functions here. Contrast with pathlib, heapq, hashlib.

I wonder if there are words from 749 that we could incorporate? Effectively, something that briefly talks to where this module fits into the landscape, perhaps aimed at the fairly experienced user of types/inspect/typing, but someone who hasn't followed the PEPs.

Sorry, something went wrong.

Uh oh!

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

All reactions

@JelleZijlstra JelleZijlstra Jul 27, 2024

Copy link
Copy Markdown
Member 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.

Yes, I was thinking of adding that too, but ran out of energy while working on the initial version. :) I'll probably work on this later.

Sorry, something went wrong.

Uh oh!

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

AA-Turner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@JelleZijlstra JelleZijlstra Sep 10, 2024

Copy link
Copy Markdown
Member 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.

I wrote such a summary now, along with a historical account of annotation semantics, since that seems like something the docs should cover.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/typing.rst Resolved

Uh oh!

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

Comment thread Doc/library/typing.rst Resolved

Uh oh!

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

Comment thread Doc/library/typing.rst Resolved

Uh oh!

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

JelleZijlstra and others added 5 commits July 27, 2024 11:49
@JelleZijlstra
More documentation
b4f6385
@JelleZijlstra @AA-Turner
Apply suggestions from code review
6ebdce9
Co-authored-by: Adam Turner <[email protected]>
@JelleZijlstra
stray whitespace
52dc99e
@JelleZijlstra
Suggestions from Adam on evaluate_forward_ref
61eedbd
@JelleZijlstra
Expand docs, based on suggestion by Adam
27668ce
@AA-Turner

AA-Turner commented Aug 7, 2024

Copy link
Copy Markdown
Member

Doctest failures:

Document: library/annotationlib
-------------------------------
**********************************************************************
File "library/annotationlib.rst", line 67, in default
Failed example:
    call_evaluate_function(Alias.evaluate_value, Format.VALUE)
Exception raised:
    Traceback (most recent call last):
      File "/home/runner/work/cpython/cpython/Lib/doctest.py", line 1395, in __run
        exec(compile(example.source, filename, "single",
        ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     compileflags, True), test.globs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[1]>", line 1, in <module>
        call_evaluate_function(Alias.evaluate_value, Format.VALUE)
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/cpython/cpython/Lib/annotationlib.py", line 421, in call_evaluate_function
        return call_annotate_function(evaluate, format, owner=owner, _is_evaluate=True)
      File "/home/runner/work/cpython/cpython/Lib/annotationlib.py", line 446, in call_annotate_function
        return annotate(format)
      File "<doctest default[0]>", line 1, in Alias
        type Alias = undefined
                     ^^^^^^^^^
    NameError: name 'undefined' is not defined
**********************************************************************

Document: library/typing
------------------------
**********************************************************************
File "library/typing.rst", line 2181, in default
Failed example:
    Alias.__value__
Exception raised:
    Traceback (most recent call last):
      File "/home/runner/work/cpython/cpython/Lib/doctest.py", line 1395, in __run
        exec(compile(example.source, filename, "single",
        ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     compileflags, True), test.globs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[1]>", line 1, in <module>
        Alias.__value__
      File "<doctest default[0]>", line 1, in Alias
        type Alias = undefined
                     ^^^^^^^^^
    NameError: name 'undefined' is not defined
**********************************************************************
File "library/typing.rst", line 2185, in default
Failed example:
    Alias.evaluate_value(Format.VALUE)
Exception raised:
    Traceback (most recent call last):
      File "/home/runner/work/cpython/cpython/Lib/doctest.py", line 1395, in __run
        exec(compile(example.source, filename, "single",
        ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     compileflags, True), test.globs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<doctest default[3]>", line 1, in <module>
        Alias.evaluate_value(Format.VALUE)
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
      File "<doctest default[0]>", line 1, in Alias
        type Alias = undefined
                     ^^^^^^^^^
    NameError: name 'undefined' is not defined
**********************************************************************
All reactions

Sorry, something went wrong.

Uh oh!

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

@JelleZijlstra
Merge remote-tracking branch 'upstream/main' into pep649-doc
6254e18
@JelleZijlstra
JelleZijlstra requested a review from willingc as a code owner September 9, 2024 23:27
@JelleZijlstra
doctest?
c42cb60
savannahostrowski
savannahostrowski reviewed Sep 10, 2024
View reviewed changes

@savannahostrowski savannahostrowski left a comment •
edited
Loading

Uh oh!

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

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.

Most of these are nits. I got curious about the PR and found some small things 🙈 !

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

@JelleZijlstra
expand
1873912
JelleZijlstra added 3 commits September 9, 2024 17:59
@JelleZijlstra
Feedback from Savannah
86001c1
@JelleZijlstra
fix link
c1943fa
@JelleZijlstra
shorter lines
889f5aa
willingc
willingc approved these changes Sep 10, 2024
View reviewed changes

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

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.

Overall, this looks good @JelleZijlstra. I'm wondering if we are going a bit too deep into implementation in the Data Model Language Reference page.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/howto/annotations.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/annotationlib.rst Resolved

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Sep 10, 2024
@JelleZijlstra @willingc
Apply suggestions from code review
6dd39fb
Co-authored-by: Carol Willing <[email protected]>
@JelleZijlstra

JelleZijlstra commented Sep 11, 2024

Copy link
Copy Markdown
Member Author

Thanks for the review @willingc! Which part do you think goes into too much detail? I looked over the data model changes and all the changes seem relevant to me.

All reactions

Sorry, something went wrong.

Uh oh!

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

@willingc

willingc commented Sep 11, 2024

Copy link
Copy Markdown
Contributor

Thanks for the review @willingc! Which part do you think goes into too much detail? I looked over the data model changes and all the changes seem relevant to me.

@JelleZijlstra I reread the data model changes again on the rendered page (instead of the diff). On the initial read, I thought there was implementation content mixed in, but I was mistaken and misled by the rST markup. Thanks for rechecking and sorry for the extra noise.

Let's 🚢 this. 😄

JelleZijlstra reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

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

@JelleZijlstra
JelleZijlstra merged commit 5436d8b into python:main Sep 11, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 11, 2024
@JelleZijlstra
JelleZijlstra deleted the pep649-doc branch September 11, 2024 14:50
@Taeknology Taeknology mentioned this pull request Jul 31, 2026
Metaclasses with type annotated attributes do not add __annotations__ = {} to derived classes. #149208
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@willingc willingc willingc approved these changes
@savannahostrowski savannahostrowski savannahostrowski left review comments
@AA-Turner AA-Turner AA-Turner left review comments
@picnixz picnixz picnixz left review comments
@AlexWaygood AlexWaygood Awaiting requested review from AlexWaygood AlexWaygood is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

docs Documentation in the Doc dir 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

@JelleZijlstra @AA-Turner @willingc @savannahostrowski @picnixz
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.