Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork944
Commitb8a25df
committed
Modify annotations to accommodate NULL_TREE
This finishes the main changes being done at this time to theannotations of diff-related methods that were started in0e1df29.As expected and noted in previous commits, having Diffable.diffpermit NULL_TREE entails a violation of the Liskov substitutionprinciple in the overridden method IndexFile.diff unless a similarchange were also made there, which could not be done correctlywithout modifying its behavior to actually accept NULL_TREE (itdoes not contain code to cover it, and raises ane exception if itis passed). I am unsure if that should ultimately be done, but evenif so, it seems to me to be beyond the scope of the typing changesbeing done here.This therefore applies a suppression there. The suppression isspecific to that one parameter. The long-standing comment atop theIndexFile.diff method, which reads as vague today, is replaced witha specific FIXME comment describing the situation where the methodrefers to the base-class docstring for documentation of itsparameters yet doesn't accept NULL_TREE (and notes the mypy error).In effect this is really restoring and fixing the suppression thatwas present before0e1df29 rather than adding a "new" one, but atthat time the base-class parameter type was much broader since itwas a union with object as one of its alternatives, so thesituation was much less clear.1 parentc9952e1 commitb8a25df
2 files changed
+6
-3
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
192 |
| - | |
| 192 | + | |
193 | 193 |
| |
194 | 194 |
| |
195 | 195 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1475 | 1475 |
| |
1476 | 1476 |
| |
1477 | 1477 |
| |
1478 |
| - | |
| 1478 | + | |
| 1479 | + | |
1479 | 1480 |
| |
1480 | 1481 |
| |
1481 |
| - | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1482 | 1485 |
| |
1483 | 1486 |
| |
1484 | 1487 |
| |
|
0 commit comments
Comments
(0)