Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement a reveal_locals expression. (#3387) #3425
This PR is a "rough draft" implementation of a
I am new to the codebase so likely this PR will need a fair bit more work and would like some feedback. I certainly need to add new tests and documentation but wanted to do that after a first round of feedback if possible.
However, it's worth considering who the "audience" of this output is. The dictionary output is more machine parseable, which could be useful for editor plugins that use this functionality. Admittedly, when I first thought of this feature, this was the use case I was thinking of.
The output should be the same for both lines. I do not know of an easy fix yet.
Feedback is welcomed. I realize there will be likely many changes to this before it is merge ready.
Some discussion with @JukkaL :
I also fixed unnecessary moving of some classes in b0ca357
There is still a bug where
@ddfisher I fixed some of the issues we discussed. I unified
The main downside is I still cannot deal with the issue where:
@ddfisher OK, I've rebased this PR against master, added some tests, added some docs, and fixed some test breakage (Travis runs successfully now) . Some of the issues I had with type inference a month ago appear to be gone, I'm assuming changes in the past month have made the method used in this PR work now. Still needs a good review though. The commits are a bit of a mess, but I will squash them once I get some feedback. Thanks for your help.
JukkaL left a comment
Looks good, I just had a few minor things. This feature will make it easier for users to troubleshoot cases when mypy doesn't work as expected. Apologies for the slow response, let's try to get this merged soon.