python: improvments