When we import typeshed internally at Dropbox, somehow the fact that
these files are all stubs gets lost (it's a long story...). This
causes errors like this:
.../stdlib/2/ast.pyi:6: error: Name 'typing' already defined (by an import)
The quickest way around this is to rename the import to _typing.
Turns out that pytype is a bit more finicky about imports, and
differentiates between '*' imports for export, and imports
for use in the local pyi. This adjusts ast.pyi to make pytype
understand it again.
After mypy [started hiding](https://github.com/python/mypy/pull/3706) imported names in stubs unless `from ... import ...` is used, we found an error with stubs of ast module.
It looks like ast module should re-export everything in `_ast` and according to PEP 484, it can do that by doing `from _ast import *`, so this is what this PR does.
python/mypy#2380 showed a discrepancy between object and FunctionType in stdlib2. The first defined __doc__ to be str, the second Optional[str]. As FunctionType depends on object, this is no longer valid.
As suggested by @gvanrossum in python/mypy#2380, all __doc__ should be considered Optional.
(Final verdict was just to remove most __doc__ attributes since it's inherited from object.)