Skip to content

WIP: add intersection types #104132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KotlinIsland
Copy link
Contributor

@KotlinIsland KotlinIsland commented May 3, 2023

This is a continuation of work done in basedmypy which supports intersection types.
KotlinIsland/basedmypy#456

This PR is just for experimentation with intersections, feel free to ignore it for now. If this kind of thing is not allowed then feel free to close it.


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

@@ -2611,6 +2612,12 @@ object_recursive_isinstance(PyThreadState *tstate, PyObject *inst, PyObject *cls
return object_isinstance(inst, cls);
}

int checking_intersection = 0;
if (_PyIntersection_Check(cls))) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (_PyIntersection_Check(cls))) {
if (_PyIntersection_Check(cls)) {

@Eclips4
Copy link
Member

Eclips4 commented May 3, 2023

Hello!
Just want to say, for a while I really thinking about something like it.
Strong +1 from me.
I cant say anything about implementation, but I really like that idea.
Please, create new topic about this idea here: https://discuss.python.org/c/ideas/6
First of all, this should be widely discussed.

@python-cla-bot
Copy link

The following commit authors need to sign the Contributor License Agreement:

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants