bpo-41428: Implementation for PEP 604 by maggiemoss · Pull Request #21515 · python/cpython · GitHub

github.com

Tin mới

maggiemoss:PEP605-implementation

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

https://github.com/pprados/cpython/tree/PEP604

Building off of the comments left on this PR here: https://github.com/pprados/cpython/tree/PEP604

Add new type object for union types

Add basic tp_* fields to union object

Squash this commit.

Squash this commit.

Add union_traverse method.

Handle Py_None in union.

Clean up syntax with Py_None

Update getattro method.

Reduce code duplication when adding union types together.

Implement a POC of the specification describe in the PEP0604

View reviewed changes

Add __or__ method to _SpecialGenericAlias

Add support for NewType with unions.

Remove old code from abstract.c

Fix warning for incompatible pointer type.

View reviewed changes

Learn more about hiding disruptive comments

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

Add support for union use in subclasses.

View reviewed changes

Lib/test/test_isinstance.py

View reviewed changes

General cleanup, fix reference leaks, add new test for possible crashes

Make unionobject APIs private

View reviewed changes

Add minor test for GenericAlias

View reviewed changes

Remove ellipsis from repr.

Remove commented out test code.

bpo-41428: Implementation for PEP 604 (