[WASM] Unvendoring some of stdlib modules

  • Would someone mind summarizing what are the potential limitations of this (also for packages), if any?

    There’s no source, so you won’t see source lines in tracebacks, and I assume the new range underlines also aren’t there. This makes debugging quite a bit harder (especially if you use a slightly different version of the source by mistake). That’s why we do it only where the source is very boring.
    And it can’t be used with different minor versions of CPython, and different implementations.

  • As far as I understand .pyc are only compatibles for a given Python minor version 3.X, so we cannot do that for universal wheels but we could do it for stdlib & binary wheels?

    I’ve never heard of stdlib wheels.
    You can do it for anything that is only installed for a specific CPython minor version.

  • Is compatibility for patch versions (3.11.X ) guaranteed?

    Yes (except Alphas/Betas of 3.Y.0).
    They’re also architecture-independent, though that probably doesn’t matter for Wasm.

  • Also in case of tracebacks does one get the original line number of the original .py files are not present?

    Yes, you do get the line number.


You might be also interested in an alternate install scheme – use/ship .pyc primarily, but make source available – that I proposed and plan to get back to eventually. For Pyodide this could be helpful if fetching source (e.g. displaying tracebacks) could be made async.