Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

No type comments on AsyncWith/AsyncFor? #27

Closed
afrieder opened this issue Jan 21, 2017 · 1 comment
Closed

No type comments on AsyncWith/AsyncFor? #27

afrieder opened this issue Jan 21, 2017 · 1 comment

Comments

@afrieder
Copy link

From Python.asdl in ast35:

For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
With(withitem* items, stmt* body, string? type_comment)
but
AsyncFor(expr target, expr iter, stmt* body, stmt* orelse)
AsyncWith(withitem* items, stmt* body)

I don't believe there's anything against using type comments in async withs/fors, and this limits how MyPy can analyze them.

@ddfisher
Copy link
Collaborator

Fixed as of 1.0.0!

tbbharaj pushed a commit to tbbharaj/typed_ast that referenced this issue Dec 6, 2021
There are valid use cases for passing a zero length string
to compress:

python-lz4/python-lz4#27
tbbharaj pushed a commit to tbbharaj/typed_ast that referenced this issue Dec 6, 2021
tbbharaj pushed a commit to tbbharaj/typed_ast that referenced this issue Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants