improve code format in python-extend-without-a-list-comprehension