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