PY-20409 Fixed: dict.get(..., None) is assumed to return None

PyTypeChecker: if expected type is UnionType, try to match actual type with its non-generic members and then with generic ones
This commit is contained in:
Semyon Proshev
2016-11-17 19:17:12 +03:00
parent a621b71b68
commit c3b92c6c88
2 changed files with 12 additions and 1 deletions
@@ -1398,6 +1398,13 @@ public class PyTypeTest extends PyTestCase {
"expr = float.fromhex(\"0.5\")");
}
// PY-20409
public void testGetFromDictWithDefaultNoneValue() {
doTest("Any",
"d = {}\n" +
"expr = d.get(\"abc\", None)");
}
// PY-20757
public void testMinOrNone() {
doTest("Union[None, Any]",