Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Check typing of in memory string. #1199

Closed
Carreau opened this issue Feb 1, 2016 · 6 comments
Closed

[question] Check typing of in memory string. #1199

Carreau opened this issue Feb 1, 2016 · 6 comments
Labels

Comments

@Carreau
Copy link
Contributor

Carreau commented Feb 1, 2016

Hi there,

I would be interested in trying to check snippets of code that are not on a file,
I'm trying to figure out how to do that simply, but constructing mypy.main.build.BuildSource with empty path and manually setting bin_dir. But that seem over-engineered.

Am I missing something ?

I would prefer not to shell out to the mypy executable as in the end the goal would be to integrate in a REPL to get warnings, so most fonction class definition would not have files.

Thanks.

@JukkaL
Copy link
Collaborator

JukkaL commented Feb 4, 2016

There's probably nothing easier than creating a BuildSource and calling mypy.build.build. We haven't thought about this use case really.

@JukkaL JukkaL added the question label Feb 4, 2016
@Carreau
Copy link
Contributor Author

Carreau commented Feb 4, 2016

There's probably nothing easier than creating a BuildSource and calling mypy.build.build. We haven't thought about this use case really.

Ok, I'll continue to poke around when I have some free time then.

Are you interested in feedback from this use case, or is it too early ?

@gvanrossum
Copy link
Member

gvanrossum commented Feb 6, 2016 via email

@Carreau
Copy link
Contributor Author

Carreau commented Feb 6, 2016

How many lines of code are we talking about here to implement a function
that does what you want? You can crib from the implementation of the "-c"
option in mypy/main.py. (You can even import mypy.main and use functions it
already defines.)

I'm not complaining about number of line of code, I'm just feeling the code has not been thought of that use case, and wether I'm missing something. For example mypy.main.build.BuildSource(path, module, text) have path and module as first argument which I set to None, I would have reversed the arguments.

I'm just trying to gently inquiring if this use case is something you think is worth considering, and if this kind of feedback (and potentially fix through PR) is welcomed, in which case, when get some time to makes such changes I'll send patches. Or if you do not think it is worth, indeed, I'll wrap that in my own utility to use.

@gvanrossum
Copy link
Member

gvanrossum commented Feb 6, 2016 via email

@ddfisher ddfisher added this to the Future milestone Mar 1, 2016
@gvanrossum
Copy link
Member

I somehow don't see a big future for mypy as a library with an API. The internals are moving too fast and the use case is not sufficiently pronounced. Maybe eventually we'll get to it but in the mean time I don't think this issue needs to remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants