Skip to content

WebIDL only describes web spec, what to do about JS builtins? #13

@hoodmane

Description

@hoodmane

In #12 I added some type tests. The biggest issue that they seem to reveal is that we don't see JS builtins. For example, suppose someone uses Object:

from js import Object

Object.fromEntries([("a", 1), ("b", 2)])

This sort of code is pretty common in practice and ideally we'd want to be able to typecheck this. Since it's not in the webidl we'd need to get the info from some other source. Unfortunately that seems like a lot of work...

Some thoughts:

  1. Maybe there are typescript type definitions that we can use?
  2. But then maybe those also cover everything in the webidl?
  3. So maybe what is actually needed is a tool for converting from typescript to mypy?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions