Commit Graph

15 Commits

Author SHA1 Message Date
kasium
f9cd5ee859 Improve ast types; revert several "redundant numeric union" changes from #7906 (#9130)
* Adapt number types in ast

Since mypy  0.990 type promotions was limited.
This means that complex is not longer promoted to int/float, therefore
we should adapt the types to list all possible types

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2022-11-14 09:41:23 +00:00
Nikita Sobolev
94dc53ee90 Mark typed_ast as completed (#9121) 2022-11-07 18:34:23 +00:00
Shantanu
7edad955a2 typed-ast: fix get_docstring, allow buffer (#9019) 2022-10-28 11:05:16 -07:00
Alex Waygood
c72c9a6c96 typed_ast.ast3: arguments.kw_defaults should be list[expr | None] (#8645)
```python
>>> from typed_ast import ast3
>>> print(ast3.dump(ast3.parse('def foo(*, arg: int) -> None: ...')))
Module(body=[FunctionDef(name='foo', args=arguments(args=[], vararg=None, kwonlyargs=[arg(arg='arg', annotation=Name(id='int', ctx=Load()), type_comment=None)], kw_defaults=[None], kwarg=None, defaults=[]), body=[Expr(value=Ellipsis())], decorator_list=[], returns=NameConstant(value=None), type_comment=None)], type_ignores=[])
```

This bug was discovered in https://github.com/python/mypy/pull/13547
2022-08-29 14:44:48 +01:00
Alex Waygood
e3d4bdc91a Third-party stubs: enforce CamelCase for type alias names (#8256)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-07-19 08:23:24 +01:00
Alex Waygood
fa636bc044 Third-party stubs: fix several fictitious type aliases (#7958) 2022-05-26 06:26:26 -07:00
Alex Waygood
76a4bd796b Simplify and correct many numeric unions (#7906)
Unblocks PyCQA/flake8-pyi#222
2022-05-21 15:25:00 +01:00
Alex Waygood
b093c90a94 Use TypeAlias for type aliases where possible, part II (#7667) 2022-04-20 20:02:47 +01:00
Alex Waygood
653f2c6ba4 Third-party stubs: import from collections.abc where possible (#7637) 2022-04-16 14:52:57 +01:00
Alex Waygood
8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Shantanu
bf92378722 Bump typed-ast version, recommend Python 3.8 for tests (#6278) 2021-11-12 02:53:42 -08:00
Sebastian Rittau
9f86972350 Add star to all non-0.1 versions (#6146) 2021-10-11 13:41:19 -07:00
Akuli
ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli
1409f6e892 change ast files to use new union syntax (#5880) 2021-08-08 15:47:33 +02:00
Ivan Levkivskyi
16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00