tristanlatr / astuce

AST inference utilities
GNU Lesser General Public License v2.1
1 stars 0 forks source link

Scope of the project #6

Open tristanlatr opened 2 years ago

tristanlatr commented 2 years ago

I believe that we should adopt clear guidelines about what kind of stuff we want to have support for. Clearly we need first class support for literals, especially list of strings, since IMO it's the whole point of this project: being able to statically resolve __all__ assignments.

But __all__ is a list, so it can be mutated with append, extend, etc, so I believe we need support for builtins as well.

So I'd propose the following goals and no-goals.

Goals:

No-goals:

tristanlatr commented 2 years ago

Here are things that astroid has great support for which we could add to astuce in the future, but not for the first version in my opinion.

For loops and generator expressions:

        for a in [1, 2, 3]:
            print (a)
        for b,c in [(1,2), (3,4)]:
            print (b)
            print (c)

        print ([(d,e) for e,d in ([1,2], [3,4])])

Dict unpack:

        base = {'data': 0}
        new = {**base, 'data': 1}
        new3 = {**base, **new}