[Python-ideas] Code version evolver

Chris Angelico rosuav at gmail.com
Sun Mar 17 19:59:25 EDT 2019


On Mon, Mar 18, 2019 at 9:34 AM Steven D'Aprano <steve at pearwood.info> wrote:
>
> On Mon, Mar 18, 2019 at 01:13:29AM +1100, Chris Angelico wrote:
> [...]
> > Yes, it will. Can you determine whether some code does this? Can you
> > recognize what kind of object is on the left of a percent sign?
> > Remember, it quite possibly won't be a literal.
>
> I don't understand whether your question is asking if Francis
> *personally* can do this, or if it is possible in principle.
>
> If the later, then inferring the type of expressions is precisely the
> sort of thing that mypy (and others) do.

Kinda somewhere between. Francis keeps saying "oh, just make a source
code rewriter", and I'm trying to point out that (1) that is NOT an
easy thing to do - sure, there are easy cases, but there are also some
extremely hard ones; and (2) even if it could magically be made to
work, it would still have (and cause) problems.

ChrisA


More information about the Python-ideas mailing list