[core][py] endswith can take a tuple as parameter