pylint-dev / pylint-dev/astroid

developer guide for inference

Open
#670 1 comment 0 reactions 0 assignees View on GitHub
Documentation :green_book: Enhancement ✨
Dominant language
Python
Stars
582
Forks
357
Avg merge
1d 1h
Merged PRs (30d)
23

Description

I'm trying to learn more about astroid - in particular inference - so I can (try to) help speed things up. However, I can't seem to find any higher level discussion of what's going on (e.g. "why do we need contexts? call contexts? why is the cache key (...)?" etc.). This issue is to request that this be provided in a "developer/contributors guide", along with maybe some examples of particular points (e.g. why we need callcontext or context cloning). And maybe a step-by-step of how an example inference actually works (each step being a different node inference, etc.). The inclusion of some descriptions of known faults/potential improvements with the current context approach might be valuable too.

The benefit from resolving this issue (aside from general niceness) may be increased contributions from the community (e.g. me). The downside may be higher overhead to maintain the docs (if the general inferencing approach changes frequently).

FYI while I have looked at the code, and while I'm not familiar with ASTs etc., I like to think I'm reasonably python savvy, and it's taking a while to understand what's going on. I think this is largely because I'm missing some key understandings (as above) and simple examples, as opposed to the code itself being confusing.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing astroid's inference implementation and the existing discussion of contexts, call contexts, cache keys, and context cloning. Document the higher-level inference model, give concrete examples and a step-by-step example inference across nodes, and record known faults or potential improvements in the current context approach. Done means contributors can use the guide to understand the design and begin working on inference.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.