File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -274,12 +274,13 @@ Because it is possible to attempt to narrow B,
274274but A does not have appropriate information about B
275275(or any other unknown subclass of A!) it's not possible to safely narrow
276276in either direction. The general rule for generics is that if you do not know
277- all the places a generic class is generic and do not enough of them to be
277+ all the places a generic class is generic and do not check enough of them to be
278278absolutely certain, you cannot return True, and if you do not have a definitive
279279counter example to the type to be narrowed to you cannot return False.
280280In practice, if soundness is prioritized over an unsafe narrowing,
281- not knowing what you don't know is solvable by erroring out
282- or by making the class to be narrowed final to avoid such a situation.
281+ not knowing what you don't know is solvable by either
282+ erroring out when neither return option is safe, or by making the class to be
283+ narrowed final to avoid such a situation.
283284
284285In practice, such correctness is not always neccessary, and may work against
285286your needs. for example, if you trust that users implementing
You can’t perform that action at this time.
0 commit comments