Repository navigation
Docs/stated limits - #76
Merged
Merged
Conversation
The note that PyCG is maintained again keeps its other sentences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The evaluation labelled every false negative on its 30 packages with a cause. Two causes were mechanisms that the design did not state. The design now states them as limits, and a test pins what the analysis reports. The analysis does not change. A getter that raises AttributeError (Lookup through an instance). Python calls the class's __getattr__ when a property's getter or a descriptor's __get__ raises AttributeError. The analysis calls __getattr__ only where no class of the MRO defines the name. Measured on the macro-benchmark of pycg-evaluation (30 packages, PyCG c5c6a89): 32 missed edges have this cause (bottle 19, structlog 8, anytree 4, asyncstdlib 1). A rule "a load of a name bound to a property or descriptor also calls the class's __getattr__", measured on a copy of the analysis, adds 31 of them and 21 wrong edges (anytree 19, bottle 2). That is more than one wrong edge for every ten true ones, the bound for admitting a rule, so the rule is not built. Test: test_limit_a_getter_that_raises_attribute_error_does_not_call_getattr. An assert narrows as if it always runs (Class tests). Under python -O an assert does not run, so the code after assert isinstance(x, C) also runs with values that are not instances of C. The analysis follows the default interpreter. Measured: 4 missed edges of h11 (normalize_and_validate and get_comma_header calling str.lower and str.split), in a ground truth that also counts runs under -O. Test: test_limit_an_assert_narrows_as_if_it_always_runs. Both programs were run under Python 3.15.2 (the assert one also with -O) to confirm what Python does, and under PyCG to confirm what the analysis reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There is no `dev` branch in the published repository: `main` is the branch, and a change reaches it through a pull request. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The redesigned analysis is PyCG 2. The version was the placeholder 0.1.0.dev0; the releases of the 2021 analysis on PyPI are 0.0.x. The output document records this version in its `generator` field. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
vitsalis
approved these changes
Nov 18, 2026
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.
No description provided.