pyodide / pyodide/webtypy

Names defined in `__init__.pyi` are not the same as names that can be imported from `js`

Open
#14 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
23
Forks
5
PR merge metrics
No merged PRs in 30d

Description

In __init__.py we see stuff like:

class WindowOrWorkerGlobalScope:
    indexedDB: IDBFactory
    ...

So this typechecks but raises an ImportError at runtime:

from js import WindowOrWorkerGlobalScope

And this is a type error but works at runtime:

from js import indexedDB

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the names exposed by init.pyi with those available at runtime from init.py, using the two import examples in the issue as starting points. Done means names that type-check can be imported from js, while names available at runtime are represented consistently in the type definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.