Title: Are there any specs for the typed AST? · Issue #4 · python/typed_ast · GitHub
Open Graph Title: Are there any specs for the typed AST? · Issue #4 · python/typed_ast
X Title: Are there any specs for the typed AST? · Issue #4 · python/typed_ast
Description: I've started experimenting with this project and it works really nice so far, but what I find that is missing is the description of the typed AST. For ordinary AST there is some effort going on here: https://greentreesnakes.readthedocs.i...
Open Graph Description: I've started experimenting with this project and it works really nice so far, but what I find that is missing is the description of the typed AST. For ordinary AST there is some effort going on her...
X Description: I've started experimenting with this project and it works really nice so far, but what I find that is missing is the description of the typed AST. For ordinary AST there is some effort going on...
Opengraph URL: https://github.com/python/typed_ast/issues/4
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Are there any specs for the typed AST?","articleBody":"I've started experimenting with this project and it works really nice so far, but what I find that is missing is the description of the typed AST. For ordinary AST there is some effort going on here: https://greentreesnakes.readthedocs.io/en/latest/nodes.html . However, is there any kind of documentation with regard to how `typed_ast.ast35` should look?\n\nE.g. `type_comment` seems to be treated as just a string. However what is done e.g. in [mypy](https://github.com/python/mypy) is the type comment is treated as code. Is that intended?\n\n```\nmy_string = None # type: typing.Optional[str]\n```\n\n```\nModule(\n body=[Assign(\n targets=[Name(\n id='my_string',\n ctx=Store())],\n value=NameConstant(value=None),\n type_comment='typing.Optional[str]')],\n type_ignores=[])\n```\n\nAnother example is here, where type annotations are not treated as strings, but are parsed normally:\n\n```\ndef function(a: int, b: int) -> int:\n return a + b\n```\n\n```\nModule(\n body=[FunctionDef(\n name='function',\n args=arguments(\n args=[\n arg(\n arg='a',\n annotation=Name(\n id='int',\n ctx=Load())),\n arg(\n arg='b',\n annotation=Name(\n id='int',\n ctx=Load()))],\n vararg=None,\n kwonlyargs=[],\n kw_defaults=[],\n kwarg=None,\n defaults=[]),\n body=[Return(value=BinOp(\n left=Name(\n id='a',\n ctx=Load()),\n op=Add(),\n right=Name(\n id='b',\n ctx=Load())))],\n decorator_list=[],\n returns=Name(\n id='int',\n ctx=Load()),\n type_comment=None)],\n type_ignores=[])\n```\n","author":{"url":"https://github.com/mbdevpl","@type":"Person","name":"mbdevpl"},"datePublished":"2016-06-15T12:34:58Z","url":"https://github.com/python/typed_ast/issues/4"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d7c56aab-a06b-de7d-ca8b-e20b1d405590 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A18A:283776:D6276A:11E4246:6B0052B0 |
| html-safe-nonce | b5f95a3d25fb1eab08696d136e3446e0a3f85f28fb385bc94994a9f640a3d11d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMThBOjI4Mzc3NjpENjI3NkE6MTFFNDI0Njo2QjAwNTJCMCIsInZpc2l0b3JfaWQiOiIzODg2OTk1MDAyOTU3NTE3NDg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | adb6f464a0f7902bffb36c9576cab6692872e1a3939b380769e3b7cafa839e21 |
| hovercard-subject-tag | issue:160411140 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typed_ast/4/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ec9f11f6b8ebd9a64d5274858e09957bc8756adefdd51e95c0e6b7a2e02ff01f/python/typed_ast/issues/4 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ec9f11f6b8ebd9a64d5274858e09957bc8756adefdd51e95c0e6b7a2e02ff01f/python/typed_ast/issues/4 |
| og:image:alt | I've started experimenting with this project and it works really nice so far, but what I find that is missing is the description of the typed AST. For ordinary AST there is some effort going on her... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mbdevpl |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typed_ast git https://github.com/python/typed_ast.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 51875828 |
| octolytics-dimension-repository_nwo | python/typed_ast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51875828 |
| octolytics-dimension-repository_network_root_nwo | python/typed_ast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width