| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thanks so far, but I also think the whole "Defining subclasses of generic classes" needs to be rewritten, as with Python 3.12 syntax, Generic isn't used anymore. |
Sorry, something went wrong.
@srittau I made a few final refinements:
Everything should now consistently reflect the Python 3.12+ style. Kindly review it again. |
Sorry, something went wrong.
|
Just checking in regarding the latest updates to this PR. Thank you! |
Sorry, something went wrong.
|
Just checking in regarding the latest updates to this PR. Thank you! |
Sorry, something went wrong.
There was a problem hiding this comment.
There are lots of remaining places in the document using the old syntax. Look for all places that still use T = TypeVar("T")-style syntax and replace them.
Sorry, something went wrong.
|
Thanks for the review! @JelleZijlstra I’ve now updated the generics reference to consistently use the PEP 695 type parameter syntax in all applicable examples, including generic functions, methods, class methods, and bounded type parameters. I kept TypeVar usage only in sections where it is still required (such as variance, constraints, decorators, and ParamSpec), so the document stays accurate for those advanced cases. Please let me know if anything else should be refined. |
Sorry, something went wrong.
|
Hi @JelleZijlstra, Just checking in regarding the latest updates to this PR. Thank you! |
Sorry, something went wrong.
|
The document still has many old-style ParamSpec and TypeVar declarations further down. It also says "By default, all user-defined generics are invariant." which is no longer correct. |
Sorry, something went wrong.
Thanks for the review @JelleZijlstra, I’ve updated the invariance statement and added the missing imports in the variance examples. I also ensured formatting consistency in the code blocks. Please let me know if anything else needs adjustment. |
Sorry, something went wrong.
|
Please stop pinging on this PR. I'm a bit tired of it because of the number of times I've had to ask you to complete the change. I'll look at it when I find the time and energy; in the meantime please do not send any more pings. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR updates the reference/generics.rst documentation to reflect the modern type parameter syntax introduced in PEP 695.
Changes include:
This improves consistency with the spec documentation and reduces confusion for users of Python 3.12+.
Fixes #2227