Allow a custom type comment prefix.#14
Conversation
Instead of hardcoding it, we expect callers to explicitly do something like
ast27.register_type_comment_prefix("# type: ")
before parsing.
|
Thanks for the PR! Before getting down to a finer-grained review, I have a few big picture comments:
|
|
So are you saying that you want two kinds of nodes for comments, one for Or can we map the former to the latter, and supply the default configuration? |
|
Yes. I think that |
|
It feels odd to me to make |
|
It should turn out simpler overall to just have a pattern for freeform comments. My understanding is that the PEP doesn't discuss custom type prefixes (type ignore or otherwise), so I'm reluctant to add those explicitly to typed_ast. |
|
This is still likely not the approach we want. Closing due to inactivity. |
Fix typos
Instead of hardcoding it, we expect callers to explicitly do something like
before parsing.
This is the typed_ast counterpiece to python/mypy#2030.