fix feature: Track relationships between narrows of different variables #997#4008
Open
asukaminato0721 wants to merge 1 commit into
Open
fix feature: Track relationships between narrows of different variables #997#4008asukaminato0721 wants to merge 1 commit into
asukaminato0721 wants to merge 1 commit into
Conversation
|
Diff from mypy_primer, showing the effect of this PR on open source code: dulwich (https://github.com/dulwich/dulwich)
+ ERROR dulwich/porcelain/subtree.py:324:34-49: Object of class `NoneType` has no attribute `id` [missing-attribute]
spark (https://github.com/apache/spark)
- ERROR python/pyspark/sql/tests/coercion/test_pandas_udf_input_type.py:73:21-23: `np` may be uninitialized [unbound-name]
- ERROR python/pyspark/sql/tests/coercion/test_pandas_udf_return_type.py:73:21-23: `np` may be uninitialized [unbound-name]
- ERROR python/pyspark/sql/tests/coercion/test_python_udf_input_type.py:73:21-23: `np` may be uninitialized [unbound-name]
- ERROR python/pyspark/sql/tests/coercion/test_python_udf_return_type.py:77:21-23: `np` may be uninitialized [unbound-name]
- ERROR python/pyspark/tests/upstream/pyarrow/test_pyarrow_array_cast.py:226:21-23: `np` may be uninitialized [unbound-name]
schemathesis (https://github.com/schemathesis/schemathesis)
+ ERROR src/schemathesis/openapi/checks.py:144:53-78: `in` is not supported between `str` and `Unresolvable` [not-iterable]
+ ERROR src/schemathesis/openapi/checks.py:144:53-78: `in` is not supported between `str` and `object` [not-iterable]
+ ERROR src/schemathesis/openapi/checks.py:146:38-61: Cannot index into `Unresolvable` [bad-index]
+ ERROR src/schemathesis/openapi/checks.py:146:38-61: Cannot index into `object` [bad-index]
+ ERROR src/schemathesis/openapi/checks.py:147:41-53: Object of class `Unresolvable` has no attribute `items`
+ Object of class `object` has no attribute `items` [missing-attribute]
+ ERROR src/schemathesis/openapi/checks.py:152:31-37: Argument `Unresolvable | bool | dict[str, Any] | dict[str, Unknown] | dict[Unknown, Unknown] | object` is not assignable to parameter `schema` with type `bool | dict[str, Any] | list[JsonSchema]` in function `schemathesis.core.jsonschema.bundler.unbundle` [bad-argument-type]
zulip (https://github.com/zulip/zulip)
+ ERROR zerver/views/auth.py:1013:41-50: Object of class `NoneType` has no attribute `url` [missing-attribute]
mypy (https://github.com/python/mypy)
- ERROR mypy/stubgenc.py:472:38-44: `output` may be uninitialized [unbound-name]
- ERROR mypy/stubtest.py:1288:9-17: `stub_sig` may be uninitialized [unbound-name]
- ERROR mypy/stubtest.py:1289:9-20: `runtime_sig` may be uninitialized [unbound-name]
sphinx (https://github.com/sphinx-doc/sphinx)
- ERROR sphinx/domains/cpp/__init__.py:1178:28-32: `decl` may be uninitialized [unbound-name]
+ ERROR sphinx/domains/cpp/__init__.py:1179:19-28: Object of class `NoneType` has no attribute `docname` [missing-attribute]
parso (https://github.com/davidhalter/parso)
- ERROR parso/python/tokenize.py:527:44-49: `token` may be uninitialized [unbound-name]
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #997
This is an experiment.
Added guarded flow facts so
if b == "bar": x = 3records that x has the branch value when the same predicate is active again.Applied matching guarded facts whenever narrowing ops are bound, recorded those facts from if branches and invalidated them on predicate/target reassignment.
Test Plan
Added regression test coverage for repeated predicates and predicate reassignment invalidation.