go-python / go-python/gpython

Support for newer python syntax

Đang mở
#136 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
1k
Fork
105
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Our team would find it useful if this package could parse an AST from code conforming to the python 3.8 grammar.

I understand that actually supporting newer python features would be a huge project. For my use case, I'm using this project to parse python code to work with the AST but don't need to actually interpret it, which is a much more minor proposition. As far as I know, python 3.8 syntax is completely backwards compatible with 3.4 (avoiding the whole walrus operator thing with python 3.9) and wouldn't even need to alter the internal representation of the AST (much, anyway).

The specific syntax changes our team keeps running into problems with are trailing commas on argument lists in some situations (e.g. after `**kwargs`) and annotations on local or class variables. The former is obviously trivial, the latter still wouldn't need any changes outside the grammar if you don't mind just throwing out the annotation information.

I'll be making these changes for our internal usage; my question is mostly whether there would be interest in a PR to upstream those changes, in which case I might be a bit less "quick and dirty" with my implementation.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.