Also pathlib is .. urgh. This is one of those that shouldn't be in the stdlib. I don't get why it is, but requests isn't.
In what way is python importing less powerful than JS? My experience is very much the opposite (to the extent that JS even has an import system).
> I don't get why it is, but requests isn't.
Because pathlib was proposed (PEP 428), considered useful and self-contained.
The requests project does not want it to be included (this was discussed at length back in 2015), and it would require merging chardet and urllib3 into the stdlib first.
And yes I'm aware why requests isn't in the stdlib, but that doesn't make it "correct". And chardet should definitely be in the stdlib. I mean, ffs, `mimetypes` is in the stdlib. urllib3 is more contentious but honestly? It probably should be as well.
SyntaxError: dynamic module import is not implemented
So no network access, and of course no FS access.
Hence, doesn't work in the browser. You need a lib or a bundler.
Source code and other examples are at: https://github.com/mdn/js-examples/tree/master/modules