See PEP 638:
https://www.python.org/dev/peps/pep-0638/

If I have understood well, it proposes what you want