Commit Graph

9 Commits

Author SHA1 Message Date
Hannes Karppila
4d86092df0 Fix return type of ast.NodeTransformer.generic_visit (#2486) 2018-10-19 08:50:50 +02:00
Guido van Rossum
d854d7e2a0 Revert "Fix signature of generic_visit method (#2100)" (#2101)
This reverts commit 39576c5d41.

I merged too soon -- tests are failing.
2018-05-07 11:21:19 -07:00
Thomas Schaper
39576c5d41 Fix signature of generic_visit method (#2100)
This methods returns something that has the same type as the first argument.
Fixes #2085.
2018-05-07 11:20:20 -07:00
Svyatoslav Ilinskiy
3f9fafbbb7 Re-export code from _ast into ast. (#1515)
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.
2017-08-03 15:57:20 -07:00
Ethan
3b30996733 Change ast's parse signature to return Module (#836) 2017-01-17 09:49:41 -08:00
Lukasz Langa
fe0e3744cc Fixing flake8 E261 errors 2016-12-19 22:09:35 -08:00
Lukasz Langa
b84f20a011 Fixing flake8 W errors 2016-12-19 21:52:56 -08:00
TrueBrain
15ec66cdd6 Consider __doc__ always Optional. (#641)
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.)
2016-10-30 11:48:23 -07:00
David Fisher
e8f626536e Add Python 3 ast module; update Python 2.7 ast module; fixup typed_ast (#170) 2016-05-04 10:40:36 -07:00