Support TypedDicts with missing keys (total=False) (#3558)

* Basic support for TypedDicts with missing keys (total=False)

Only the functional syntax is supported.

* Support get(key, {}) and fix construction of partial typed dict

* Fix subtyping of non-total typed dicts

* Fix join with non-total typed dict

* Fix meet with non-total typed dicts

* Add serialization test case

* Support TypedDict total keyword argument with class syntax

* Attempt to fix Python 3.3

* Add minimal runtime `total` support to mypy_extensions

There is no support for introspection of `total` yet.

* Fix tests on pre-3.6 Python and improve introspection

Make TypedDict `total` introspectable.

* Fix lint

* Fix problems caused by merge

* Allow td['key'] even if td is not total

* Fix lint

* Add test case

* Address review feedback

* Update comment
1 file changed
tree: 8bc0815ccd870615f75661c9d6a942c02b0147ea
  1. mypy_extensions.py
  2. README.md
  3. setup.py
README.md

Mypy Extensions

The “mypy_extensions” module defines experimental extensions to the standard “typing” module that are supported by the mypy typechecker.