mypy
[mypyc] Detect always defined attributes
#12600
Merged

[mypyc] Detect always defined attributes #12600

JukkaL merged 100 commits into master from always-defined-inheritance-5
JukkaL
JukkaL [mypyc] Make BaseAnalysisVisitor generic
7f3c3856
JukkaL [WIP] Start work on always defined attributes analysis
d3e17ba3
JukkaL Fix issues caused by rebase
7c7db8e6
JukkaL Add missing import
89c65cfc
JukkaL Fixed to arbitrary execution visitor
79d2dd41
JukkaL Add missing cases to visitor
9ba9a77d
JukkaL Remove attr initialization detection from main ir build phase
05f596b6
JukkaL Revert more changes
f3d55e0b
JukkaL Add attribute defined implementation
41c7c9e5
JukkaL Remove unused imports
31e413cb
JukkaL Partial implementation of always defined attr analysis using IR
8540685e
JukkaL Fix some special cases
c329c6fc
JukkaL [mypyc] Keep track of functions that won't run arbitrary code
64bab0ad
JukkaL Functions that can't run arbitrary code are fine
32e4cab3
JukkaL Add docstring
70c18a79
JukkaL Remove original attempt that worked on mypy ATSs
129ec0d0
JukkaL Detect initialization-only setattr ops
4ee15589
JukkaL Fix initialization of always defined attributes
cd2132a5
JukkaL Add test cases
08262f1c
JukkaL Add test cases
f9a97411
JukkaL Add comment
181a334b
JukkaL Fix asserts
b9b601be
JukkaL Refactor + add docstrings and comments
4b385d4a
JukkaL Record which attributes have default values in class body
d2fe8617
JukkaL Treat attributes initialized in class body as always defined
ae2568cb
JukkaL Add IR build test case for attribute default
b076a427
JukkaL Add tests
3194d924
JukkaL Fix issues caused by rebase
d79baad1
JukkaL Update singledispatch test cases
37e5508e
JukkaL Analyze always defined attributes across class hierarchy
ef38388a
JukkaL Fix multiple inheritance levels in hierarchy
92e7eb9a
JukkaL Add tests
6cf694cd
JukkaL DEBUG PRINT
789e63f3
JukkaL Update failing irbuild tests
7aff66e7
JukkaL Fix class IR serialization
025fca57
JukkaL Fix serialization
cded5cdb
JukkaL Fix attributes initialized like "x = None # type: str"
27482a0a
JukkaL Fix dataclass and attrs defaults
6b411c39
JukkaL Update test case
1ebf1708
JukkaL Improve docstrings
5cfb7f98
JukkaL Unrelated: remove obsolete comment
bf4a664a
JukkaL Also consider "dirty" transitions through branches and gotos
6b49963b
JukkaL List comprehensions don't run arbitrary code
1ae5b542
JukkaL Refactor test case
fafec1d9
JukkaL Deletable attributes can't be always defined
70395d0a
JukkaL Derived class may affect always defined status in base
4963ca3f
JukkaL Avoid generating branches for always defined attribute gets
e28dfaa5
JukkaL Add comment
b30e532d
JukkaL Accept undefined values in setter
6b3e98eb
JukkaL WIP docstring update (no correnponding implementation change)
9a1c6795
JukkaL Fix after rebase
e58fb360
JukkaL Fix lint
7b1ac7a2
JukkaL Use self leaks instead of running arbitrary code in analysis
cc9615ef
JukkaL Always check for uninitialized values in CPython getter
0bd79261
JukkaL Implement Type shallow copy visitor to avoid copy.copy()
1d506473
JukkaL Fix issues with new __new__ semantics
a7d909b4
JukkaL Add del attr test case
2f595be2
JukkaL Add more inheritance tests
4ff3fc07
JukkaL Add some simple trait tests
b4e32dc5
JukkaL Test with allow_interpreted_subclasses
fc9c657f
JukkaL Test additional kinds of expressions
a7a66f72
JukkaL Add test cases
23eacc87
JukkaL Fixes to properties
d94963a9
JukkaL Fix handling of self in assignments
16c59cc2
JukkaL Docstring updates
c62b4866
JukkaL Update try statement test case
4ddfe841
JukkaL Add try/finally test case
ac0761d9
JukkaL Add with test case
69d15e00
JukkaL Add test case
41efa34a
JukkaL Rename defined -> selfleaks
093fcf3b
JukkaL Add test case for Python base class
0659f596
JukkaL Add incremental mode test case
3fcec576
JukkaL Improve documentation of tests for multi-file and separate modes
18534fbf
JukkaL Comment out debug print
1539ad28
JukkaL Fix after rebase
cbb5f378
JukkaL Fix after rebase
709f29e7
JukkaL Fix copying of ParamSpecType
e494eb2c
JukkaL Update docstring
42764d15
JukkaL Support copying Parameters
c575d442
JukkaL Clean up
3c3ad7a3
JukkaL Remove another use of copy.copy()
28ba7261
JukkaL Fix crash during compilation
335fc21f
JukkaL Fix stubgen test failures
53eb2cc1
JukkaL Simplify a bit
8371b60a
JukkaL Improve test case
e83cc7c7
JukkaL Update comments
5aa0fefb
JukkaL Drop run arbitrary code flags
47d25d3e
JukkaL Kepe track of sometimes initialized attributes in __init__
8d1dca29
JukkaL Fix lint
3d96774e
JukkaL Fix syntax on older Python versions
20861b9d
JelleZijlstra
JelleZijlstra commented on 2022-04-16
github-actions
JukkaL
JukkaL
github-actions
github-actions
jhance
jhance commented on 2022-04-19
JukkaL JukkaL requested a review from msullivan msullivan 4 years ago
jhance
jhance commented on 2022-04-19
jhance
jhance commented on 2022-04-19
jhance
jhance commented on 2022-04-19
jhance
jhance commented on 2022-04-19
msullivan
msullivan commented on 2022-04-22
msullivan
msullivan commented on 2022-04-22
JukkaL Merge branch 'master' into always-defined-inheritance-5
24777049
JukkaL Support TypeVarTupleType
96e99d61
JukkaL Address some feedback
fed8ecd9
JukkaL Rename init_unknown_code to init_self_leak
53caf2b0
JukkaL Update comments based on feedback
8e371a7c
JukkaL Adjust GenAndKill based on feedback
dd436fba
github-actions
JukkaL Allow supporting pickle/copy by using @mypyc_attr(serialize=True)
e409f5de
JukkaL Document the serializable flag
d3cc68b1
JukkaL Fix example
49efa36c
github-actions
github-actions
ilevkivskyi
ilevkivskyi approved these changes on 2022-05-16
JukkaL Address feedback
51e23b03
github-actions
JukkaL JukkaL merged 7bd6fdd3 into master 4 years ago
JukkaL JukkaL deleted the always-defined-inheritance-5 branch 4 years ago

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone