Commit Graph

14 Commits

Author SHA1 Message Date
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Ivan Levkivskyi
50d98acc76 Remove redundant variable definitions in ast module (#2986) 2019-05-13 19:32:24 +02:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Guido van Rossum
e08a5ac367 Tweak how ast.pyi imports typing (#2668)
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.
2018-12-04 17:25:23 +01:00
Utkarsh Gupta
3e4737c683 ast.pyi: Fix return type of generic_visit() (#2667)
Fixes #2085
2018-12-04 08:02:39 +01: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
Matthias Kramm
03ec4023ff Adjust ast imports to make pytype happy. (#1617)
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.
2017-09-22 06:27:27 -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
Roy Williams
31d7393cae Support calling eval and ast module with unicode in Python 2 (#1440) 2017-06-26 19:06:17 -07:00
Ethan
3b30996733 Change ast's parse signature to return Module (#836) 2017-01-17 09:49:41 -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
Guido van Rossum
cb97bb54c0 Move 2.7 to 2 (#635)
Closes #579.
2016-10-26 16:24:49 -07:00