adding python counterpart