True, but I think that source transformation on import are already supported in Python ("officially") based on importlib [0-1].
Here's an example use cases where the author is trying to create a Python enum from Thrift specs: [2]. The issue here is that the spec code is not necessarily valid Python, but can be fixed easily with some search & replace operations.
[0] https://docs.python.org/3/reference/import.html [1] https://docs.python.org/3/library/modules.html [2] http://wakandan.github.io/2018/06/07/python3-import-hook.htm...