Commit fdea2a1
Add typing annotations to guard and source
Summary:
X-link: pytorch/executorch#12986
As part of better engineering week, we would like to improve out type support to improve dev experience in dynamo
This PR adds strict typing support to a critical set of files for dynamo, `source.py` and the base `_guards.py`
Running
```
mypy torch/_dynamo/source.py torch/_guards.py --linecount-report /tmp/coverage_log
```
| -------- | Lines Unannotated | Lines Total | % lines covered | Funcs Unannotated | Funcs Total | % funcs covered |
| -------- | ------- | -------- | ------- | ------- | ------- | ------- |
| Main | 1227 | 2208 | 55.57% | 207 | 362 | 57.18% |
| This PR | 2217 | 2217 | 100.00% | 362 | 362 | 100.00% |
| Delta | +990 | +9 | +44.43% | +155 | 0 | +42.82% |
cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 jerryzh168 voznesenskym penguinwu EikanWang Guobing-Chen zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben
X-link: pytorch/pytorch#158397
Reviewed By: JacobSzwejbka, yangw-dev
Differential Revision: D79199389
Pulled By: Lucaskabela
fbshipit-source-id: 10b5d9d6ddb4b0797ea795ac8a1f1eaaa512b2ae1 parent 28b27b9 commit fdea2a1
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2644 | 2644 | | |
2645 | 2645 | | |
2646 | 2646 | | |
2647 | | - | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
2648 | 2650 | | |
2649 | 2651 | | |
2650 | 2652 | | |
| |||
4765 | 4767 | | |
4766 | 4768 | | |
4767 | 4769 | | |
4768 | | - | |
| 4770 | + | |
4769 | 4771 | | |
4770 | 4772 | | |
4771 | 4773 | | |
0 commit comments