Comments (5)
I'll try my hand at this. I think I can do this, at least for pure/mixed python modules, don't know about Pure C modules though.
from mypy.
I have already started this at https://github.com/ashleyh/mypy-stubgen but
feel free to improve it! I can tell you some things that need fixing if you
like....
On 24 January 2013 16:47, Varriount [email protected] wrote:
I'll try my hand at this. I think I can do this, at least for
pure/mixed python modules, don't know about Pure C modules though.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/43#issuecomment-12660415.
from mypy.
Well, what needs fixing? This may sound strange, but I prefer being told what to do, rather than trying to improve things on my own.
Edit - Looking at the stubgen layout, wouldn't it be better to actually parse the python files, the same way that mypy does? Simply importing files can be.. problematic if modules are made to run processes and such on import.
from mypy.
I actually just added some issues to the mypy-stubgen issue tracker ;-)
I also added a link to the code on the mypy wiki page.
Parsing Python files could be useful for things like attributes of Python classes. Doing the analysis at runtime can be useful, as it lets the tool also inspect C extension modules and it can inspect the runtime types of variables, etc.
from mypy.
I've reimplemented stub generation (https://github.com/JukkaL/mypy/blob/master/mypy/stubgen.py). It actually has two stub generators, one for Python modules and one for C modules. It generates Python module stubs from the AST, and it uses runtime inspection for C modules. It only supports Python 3 as of now. I've already generated a bunch of (dynamically typed) stubs for modules such as zlib
, xml.etree
, etc.
from mypy.
Related Issues (20)
- Missing type narrowing with Literal[-1] HOT 1
- Annotate *args/**kwargs based on the signature of another class/function HOT 2
- Crash on `run_in_executor`
- Spurious error for dataclass(slots=True)
- `--extra-checks` is too strict when using `Concatenate` within a `Protocol` HOT 1
- `has no attribute "__aiter__"; maybe "__enter__"? (not async iterable)` when async iterating
- TypeVarTuple causes mypy crash
- Async iterator + inheritance = error HOT 1
- INTERNAL ERROR: maximum semantic analysis iteration count reached on self-referential union
- Restrictions on class patterns (match statement) are too strict / (possible cause: too eager to alias types) HOT 1
- INTERNAL ERROR on match-case statement HOT 1
- Possible false positive for override HOT 6
- MyPy doesn't report any errors when using TypeVars within TypeVar constraints HOT 1
- `TypeGuard` has no effect when nested in the presence of other problems
- Match exhaustiveness with class inheriting from tuple HOT 1
- Type of a function NOT allowed to raise an exception HOT 1
- Exhaustiveness check is not run for functions returning None HOT 1
- false error with simple nested structure
- Values of TypedDict typed as `object` HOT 2
- Incompatible return value type `type[Enum]` when returning a functional-style Enum
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mypy.