Implementing compatibility with python lib