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

GenericPath test failing after typeshed upgrade #1654

Open
jakebailey opened this issue Oct 9, 2019 · 5 comments

Comments

@jakebailey
Copy link
Member

commented Oct 9, 2019

After upgrading typeshed to a newer version, the GenericPath test fails. It looks like the __truediv__ function on Path/PurePath/etc do not have their return values set correctly. The code added in #1463 doesn't even execute.

Split from #1371, since this is taking a good chunk of time investigating.

@jakebailey jakebailey added this to the October 2019.1 milestone Oct 9, 2019
@jakebailey jakebailey self-assigned this Oct 9, 2019
@jakebailey

This comment has been minimized.

Copy link
Member Author

commented Oct 9, 2019

When building the overload, it tries to look up _P, but with the new typeshed, _P doesn't exist in the global scope. On master, it is in the global scope.

@jakebailey

This comment has been minimized.

Copy link
Member Author

commented Oct 9, 2019

Change:

_P = TypeVar('_P', bound=PurePath)

To:

_P = TypeVar('_P', bound='PurePath')

And it works. I'm not sure that this should be legal, as PEP 484 says that forward references need to be wrapped in quotes, and we assume this behavior...

@jakebailey

This comment has been minimized.

Copy link
Member Author

commented Oct 9, 2019

Filed python/typeshed#3334. Worst case I can pin to something before that change, but typeshed hasn't yet fully updated to 3.8's new stuff yet as far as I can tell.

@jakebailey

This comment has been minimized.

Copy link
Member Author

commented Oct 9, 2019

image

Handling the assignment of _P, it goes and tries to evaluate the TypeVar call, which then makes its way down to handling the evaluation of PurePath

@jakebailey

This comment has been minimized.

Copy link
Member Author

commented Oct 9, 2019

Can be fixed by skipping the extra eval in GetValueFromName if the module being analyzed is a stub. Better fixed by using lazy references (future).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.