-
-
Notifications
You must be signed in to change notification settings - Fork 293
Complete cache key for inference tip #2158
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
Merged
jacobtylerwalls
merged 14 commits into
pylint-dev:main
from
jacobtylerwalls:incomplete-cache-key
May 6, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d1b73d1
Complete cache key for inference tip
jacobtylerwalls 171c48b
Adjust type annotation
jacobtylerwalls 0771987
Add is_empty() to InferenceContext
jacobtylerwalls 370b630
fixup! Add is_empty()
jacobtylerwalls 38955bf
Add __hash__() and __eq__() to InferenceContext
jacobtylerwalls b923101
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 04b0735
fixup! Add __hash__
jacobtylerwalls d8a810f
Restore the recursion guard using a partial cache key
jacobtylerwalls cb5b291
Remove `__eq__()` and `__hash__()`
jacobtylerwalls e054f40
fixup! Restore
jacobtylerwalls e735438
Add comment.
jacobtylerwalls 0fa0233
Remove assertion
jacobtylerwalls 30f249d
Merge branch 'main' into incomplete-cache-key
jacobtylerwalls a79a2a7
Remove optionality of list[InferenceResult]
jacobtylerwalls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -930,13 +930,7 @@ class A: | |
assert inferred.value == 42 | ||
|
||
def test_typing_cast_multiple_inference_calls(self) -> None: | ||
"""Inference of an outer function should not store the result for cast. | ||
|
||
https://github.com/pylint-dev/pylint/issues/8074 | ||
|
||
Possible solution caused RecursionErrors with Python 3.8 and CPython + PyPy. | ||
https://github.com/pylint-dev/astroid/pull/1982 | ||
""" | ||
"""Inference of an outer function should not store the result for cast.""" | ||
ast_nodes = builder.extract_node( | ||
""" | ||
from typing import TypeVar, cast | ||
|
@@ -954,7 +948,7 @@ def ident(var: T) -> T: | |
|
||
i1 = next(ast_nodes[1].infer()) | ||
assert isinstance(i1, nodes.Const) | ||
assert i1.value == 2 # should be "Hello"! | ||
assert i1.value == "Hello" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π |
||
|
||
|
||
class ReBrainTest(unittest.TestCase): | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.