Skip to content
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

No bounds if type param present #885

Conversation

beauxq
Copy link
Contributor

@beauxq beauxq commented Nov 17, 2024

This is a pull request onto the narrowing generics branch, not onto main.

And I've pulled from current main here, so if you pull from main on that target branch, it will clean up the diff here.


This fixes the test case that was failing, and also #745 (comment) (which were really the same issue).

And also changes to use this new narrowing on Any and Unknown as discussed in #745 (comment)

It also adds a few more test cases.

@DetachHead
Copy link
Owner

awesome thanks! will take a look at this later today. i assumed the fix would be very difficult but i guess it was something simple i was missing

do you mind removing the upstream commits? i only do upstream merges when there's a new release. or if it's too much of a hassle i can do that myself

@beauxq
Copy link
Contributor Author

beauxq commented Nov 17, 2024

I think I only pulled from basedpyright main, not from pyright.
That's the "pull from main" I'm talking about.

Your branch in #745 was a month old.

@DetachHead
Copy link
Owner

ah i see, all good then

@DetachHead DetachHead force-pushed the isinstance-narrow-generics-to-bound branch from 82d3320 to 7f1d22e Compare November 18, 2024 08:58
@DetachHead
Copy link
Owner

i've cherrypicked your commits into #745 and rebased onto main. the primer identified an issue with constrained typevars (#745 (comment)). i dont think it'd be too hard to fix, i'll try to look into it within the next couple days, but if you'd rather give it a go feel free

thanks again for the help!

@DetachHead DetachHead force-pushed the isinstance-narrow-generics-to-bound branch from 9a3e3d1 to 1a71f1d Compare November 21, 2024 11:18
@DetachHead
Copy link
Owner

closing this since i've merged your commits into #745 and fixed the issue with constraints

@DetachHead DetachHead closed this Nov 21, 2024
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