-
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
Conversation
|
Hi @jolaf , Thanks for the contributions, To help with the review can you specify which version and runtime of pyscript you have based and verified your changes on? I also have an update stewing, and I want to prevent that undoing parts of your work |
|
I'm working with PyScript 2025.11.2. |
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.
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.
the _typeshed.pyi stub is already available in all typecheckers and should not be overwritten from this package.
doing that will likely disrupt all static typecheckers and IDE;s
ref : https://github.com/python/typeshed/blob/main/stdlib/_typeshed/__init__.pyi
| # Copyright (c) 2020-2025 Jos Verlinde | ||
| # MIT Licensed | ||
|
|
||
| __all__ = [ |
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.
what is the purpose of removing __all__ ?
removing it will expose module attributes that are not public , or not actually available at runtime.
I know it is a bit of a hassle to add to it , but that is part of the price to pay for stability and reliability,
| @@ -0,0 +1,14 @@ | |||
| from __future__ import annotations | |||
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.
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.
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.
the should not be any py.typed in stub only packages.
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.
no py.typed
| """ | ||
|
|
||
| def __init__(self, name, error) -> None: ... | ||
| def __init__(self, name: str, error: BaseException) -> None: ... |
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.
Is there a special reason you need BaseExeption rather than the normal Exception ?
| from js import Event as JsEvent, FileList | ||
|
|
||
| from .events import Event | ||
| from ._typeshed import 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.
why not just _typeshed ?
._typeshed is not needed, unclear and risky
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.
I think there are a large number of very good improvements.
I have made a number of comments on things that I think should be changes , and question on the changes that I did not understand the pupose of.
To keep track of version specific changes - it may be useful to add a #version_comment
I did not do a full verification test - but I will likely need to update that test to the updated interfaces as well.
See: https://github.com/Josverl/micropython-stubs/tree/main/tests/quality_tests/check_webassembly
I'm writing a PyScript app, and I see a lot of situations where the stubs are incorrect and incomplete.
After struggling for some I've decided to do something with it and updated the stubs so that they've become effective for my projects.
They're still incomplete but less incomplete than before.