💊 Optimize Python >=3.8 type comments support method i90.#95
💊 Optimize Python >=3.8 type comments support method i90.#95isidentical merged 3 commits intohakancelikdev:masterfrom hadialqattan:i90
Conversation
isidentical
left a comment
There was a problem hiding this comment.
Instead of trying version check on every possible node, you can just create a function named def _type_comment(node: ast.AST) -> None which does the job by using getattr, not the version check, since we might switch to typed_ast to use this feature on all possible versions. Example;
def type_comment(node: ast.AST) -> None:
if isinstance(node, ASTFunctionT): mode="func_type"
else: mode="eval"
type_comment = getattr(node, "type_comment", None)
if type_comment is not None: ....
I agree with you! |
|
By the way, do you like to join our telegram group? |
Of course! |
I hope it's an English group because I can't speak Turkish! |
Indeed! |
Ok, so please send the invitation link to alqattanhadizaki@gmail.com |
You are in the group, check the telegram. |
Thanks a lot! |
* 💊 Optimize Python >=3.8 type comments support method * getattr instead of version check. * Make ASTFunctionT global.
No description provided.