mirror of https://github.com/pyodide/pyodide.git
e4edd7a4d2
Before we had a single `JsProxy` documentation class. Apparently mypy treated it as `Any`. It had a bunch of methods on it that may or may not appear in any specific ` sProxy`. This does two things: 1. Split up `JsProxy` class into several synthetic subclasses like `JsArray`, `JsBuffer` etc. These work much better with mypy, they should also improve documentation layout and it helps when different subclassess have different methods with the same name (e.g., `JsArray` and `JsMap` both will have `pop` methods). 2. Make `isinstance` and `issubclass` work correctly both with synthetic `JsProxy` classes like `JsArray`, `JsBuffer` etc and with `type(an_actual_jsproxy)`. This cleans up the bootstrapping mess in `_importhook` because the `JsProxy` from `_core_docs` works fine for instance checks now. I had to make changes to various other Python files because mypy now understands the types better and noticed that there were type errors. For instance, this fixed several minor mistakes in the types in `http.py`. |
||
---|---|---|
.. | ||
code.md | ||
console.md | ||
ffi.md | ||
http.md | ||
webloop.md |