On Mon, Mar 18, 2019 at 9:34 AM Steven D'Aprano <st...@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
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to