Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

25: The Python modules generated beside .ss files

W2501

A hand-written module has the generated module’s name. The language server and shapescript pymodules write the Python module for a .ss file beside it, model.py for model.ss, but only over a file they generated, whose first line says so. Here model.py is someone’s own module, so it’s left alone. Without shapescript.install(), import model then imports model.py, not model.ss, and editors read model.py for its types.

warning[W2501]: `model.py` beside this file wasn't generated by ShapeScript, so it isn't replaced with the Python module for `model.ss`

Rename one of the two files, or delete model.py to have it generated. The language server reports this on the .ss file when it’s opened or saved.