Pyan3 v1.0.1
Bugfixes:
- crash in analyzer when resolving
super()
call with no known bases - crash in
collapse_inner()
during postprocessing - use
/usr/bin/env python3
instead of hard-coded/usr/bin/python3
in hashbang inpyan.py
to support virtualenvs correctly
Enhancements:
- analyze the
with
statement: add uses edges from the node containing thewith
block to__enter__
and__exit__
methods of thewith
'd object; also track binding fromwith ... as foo
(single target only for now, and__enter__
is assumed toreturn self
) - analyze instantiation: add a uses edge to
MyClass.__init__
for a call toMyClass()
- node flavoring both in analysis and in output (class, function, method, staticmethod, classmethod)
- figure out which names correspond to arguments in FunctionDef; prevent leakage of matching names from the enclosing scope. This fixes some spurious edges.
- avoid adding a uses wildcard when resolving
super()
fails. This fixes spurious, possibly seemingly recursive, uses edges in the case that part of the class hierarchy is not available for analysis. (The most common reasons forsuper()
resolution to fail are that either the analyzer is still running pass 1 [MRO is computed between passes], or some relevant source file is not in the analyzed set.)
Technical improvements:
- refactor analyzer: split into the main class and
anutils
- reorder methods in the analyzer main class to make the source code more logical to read for humans