ansasaki / abimap

A helper for library maintainers to use symbol versioning
MIT License
7 stars 1 forks source link

use extend for lists when source is also a list #4

Closed tomato42 closed 6 years ago

tomato42 commented 6 years ago

https://github.com/ansasaki/symbol_version/blob/f441d3446bcb325df9a3ae440313d30da2646952/scripts/symbol_version.py#L144-L146

is equivalent to:

new_version.extend([0] * len(version[2:])) 

that's because a slice past end of list will return an empty list:

a = [1, 2]
print(a[10:])

will output

[]

Same for multiplying a list by 0.