bpo-41370: Evaluate strings as forward refs in PEP 585 generics by NiklasRosenstein · Pull Request #30900 · python/cpython · GitHub

github.com

Tin mới

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

convert strings in PEP 585 generic aliases (types.GenericAlias) to …

add unittest for new get_type_hints() behaviour on PEP 585 generics w…

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

awaiting core review

awaiting core review

add unit test for from __future__ import annotations

add test for recursive type

📜🤖 Added by blurb_it.

Double backticks because RST.

Update Lib/typing.py

View reviewed changes

Update Misc/NEWS.d/next/Library/2022-01-27-11-54-16.

View reviewed changes

Merge branch 'main' into issue41370

Replace assertIs with assertEqual in test_get_type_hints_annotated

View reviewed changes

Add typing to 3.11 What's New #91491

typing.get_type_hints() works for Callable[[], None] from the typing module, but not collections.abc #91621

gh-91621: Fix typing.get_type_hints for collections.abc.Callable #91656

PEP 585 and ForwardRef #85542

Support subcriptable types and new Union Type tefra/xsdata#681

Add option to use union operator and subscriptable types for type annotations tefra/xsdata#680

Feature request: backport typing fix in 3.11 to evaluate strings as forward refs in PEP 585 generics alexmojaki/eval_type_backport#10

Support usage of type with typing.Self and type aliases pydantic/pydantic#10621

Only mark model as complete once all fields are complete pydantic/pydantic#11759

No ForwardRef in model_fields annotations with list['Model'] field type with legacy-style annotations (w/o from __future__ import annotations) pydantic/pydantic#12610

Require types passed to GenerateSchema.generate_schema() to be evaluated pydantic/pydantic#13583