rebuilt python gain, commenting mypy