-
Notifications
You must be signed in to change notification settings - Fork 2
Cleanup #3
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
base: main
Are you sure you want to change the base?
Cleanup #3
Changes from all commits
c894393
a3bc876
6d58559
4dc3c29
20afb05
db892a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Buffer, Iterable | ||
| from typing import Any | ||
|
|
||
| from typing import ClassVar | ||
|
|
||
| class Blob: | ||
| @classmethod | ||
| def new(cls, blobParts: Iterable[Any], options: Any) -> Blob: ... | ||
| async def arrayBuffer(self) -> int: ... | ||
|
|
||
| class CSSStyleSheet: | ||
| @classmethod | ||
| def new(cls) -> CSSStyleSheet: ... | ||
| def replaceSync(self, text: str) -> None: ... | ||
|
|
||
| class Event: | ||
| @classmethod | ||
| def new(cls, name: str) -> Event: ... | ||
|
|
||
| class File(Blob): | ||
| name: str = ... | ||
|
|
||
| class FileList: | ||
| length: int = ... | ||
| def item(self, index: int) -> File: ... | ||
|
|
||
| class Node: | ||
| TEXT_NODE: ClassVar[int] = ... | ||
| nodeType: int | ||
| nodeValue: str | ||
| def append(self, *args: Node | str) -> None: ... | ||
|
|
||
| class NodeFilter: | ||
| SHOW_TEXT: ClassVar[int] = ... | ||
|
|
||
| class Text(Node): ... | ||
|
|
||
| class Uint8Array: | ||
| @classmethod | ||
| def new(cls, bytes_: Buffer) -> Uint8Array: ... | ||
|
|
||
| class URL: | ||
| @classmethod | ||
| def createObjectURL(cls, object: Any) -> str: ... | ||
| @classmethod | ||
| def revokeObjectURL(cls, url: str) -> None: ... | ||
|
|
||
| class Location: | ||
| def reload(self) -> None: ... | ||
|
|
||
| location: Location |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from __future__ import annotations | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. l suggest to to add a docstring here that this submodule is (AFAIK) only available python/pyodide and not to MicroPython (currently it is not yet possible for typecheckers / IDEs to filet on this , so we need to communicate this in a human readable manner. |
||
|
|
||
| from js import Node | ||
|
|
||
| class ArrayBuffer: | ||
| def to_bytes(self) -> bytes: ... | ||
|
|
||
| class JsNull: ... | ||
|
|
||
| class JsProxy: | ||
| nodeType: int | ||
| nodeValue: str | ||
| def append(self, *args: Node | str) -> None: ... | ||
| async def arrayBuffer(self) -> ArrayBuffer: ... | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the should not be any py.typed in stub only packages. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,8 @@ PyScript makes available convenience objects, functions and attributes. | |
|
|
||
| These APIs will work with both Pyodide and MicroPython in exactly the same way. | ||
|
|
||
| PyScript can run in two contexts: the main browser thread, or on a web worker. T | ||
| he following three categories of API functionality explain features that are common for: | ||
| PyScript can run in two contexts: the main browser thread, or on a web worker. | ||
| The following three categories of API functionality explain features that are common for: | ||
| - both main thread and worker, | ||
| - main thread only, | ||
| - and worker only. | ||
|
|
@@ -16,32 +16,13 @@ he following three categories of API functionality explain features that are com | |
| # Copyright (c) 2020-2025 Jos Verlinde | ||
| # MIT Licensed | ||
|
|
||
| __all__ = [ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the purpose of removing removing it will expose module attributes that are not public , or not actually available at runtime. |
||
| "PyWorker", | ||
| "config", | ||
| "current_target", | ||
| "display", | ||
| "document", | ||
| "fetch", | ||
| "js_import", | ||
| "js_modules", | ||
| "py_import", | ||
| "storage", | ||
| "sync", | ||
| "window", | ||
| "workers", | ||
| "HTML", | ||
| "Event", | ||
| "WebSocket", | ||
| "create_named_worker" | ||
| ] | ||
| from __future__ import annotations | ||
|
|
||
|
|
||
| from polyscript import lazy_py_modules as py_import # type: ignore | ||
| from pyscript.display import HTML as HTML, display as display | ||
| from pyscript.events import Event as Event, when as when | ||
| from pyscript.fetch import fetch as fetch | ||
| from pyscript.magic_js import ( | ||
| from .polyscript import lazy_py_modules as py_import | ||
| from .display import HTML as HTML, display as display | ||
| from .events import Event as Event, when as when | ||
| from .fetch import fetch as fetch | ||
| from .magic_js import ( | ||
| RUNNING_IN_WORKER as RUNNING_IN_WORKER, | ||
| PyWorker as PyWorker, | ||
| config as config, | ||
|
|
@@ -50,12 +31,13 @@ from pyscript.magic_js import ( | |
| js_import as js_import, | ||
| sync as sync, | ||
| window as window, | ||
| js_modules as js_modules | ||
| js_modules as js_modules, | ||
| TreeWalker as TreeWalker, | ||
| ) | ||
|
|
||
| from pyscript.storage import Storage as Storage, storage as storage | ||
| from pyscript.websocket import WebSocket as WebSocket | ||
| from pyscript.workers import create_named_worker as create_named_worker, workers as workers | ||
| from .storage import Storage as Storage, storage as storage | ||
| from .websocket import WebSocket as WebSocket | ||
| from .workers import create_named_worker as create_named_worker, workers as workers | ||
|
|
||
| if not RUNNING_IN_WORKER: | ||
| ... | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the _typeshed.pyi stub is already available in all typecheckers and should not be overwritten from this package. ref : https://github.com/python/typeshed/blob/main/stdlib/_typeshed/__init__.pyi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
|
|
||
| class Incomplete: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stub-only packaged should not contain a py.typed marker file.