Skip to content

A couple of _ast related issues #4760

Closed
@isidentical

Description

@isidentical

I was checking out the type stub, and found these points;

While examining this, I got an idea of autogenerating stub files by inputting a program with ASDLs (abstract syntax description language). So I wrote generators/typing_stub.py to my ASDL implementation, also generated test stub file.

I didn't test using that stub file, so don't know if there is a problem with it, but from a high level view they look similar with the _ast.pyi here, plus it covers the points I just mentioned (be aware, it is completely auto generated). There is only a single problem with that stub file, it ignores one of the broken parts of our AST. Dict(expr* keys, expr* values) actually doesn't describe the Dict well since when one of the items is **star_unpack the keys will contain None (so it should be List[Optional[expr]] not List[expr]). The currently type stub handles it, so if anyone wants to make a PR by copying things over the auto generated type stub, this point should not be actually copied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions