If you want to create an iterable of fixed length in Python, use collections.deque with the maxlen parameter.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

import collections
fixed_list = collections.deque(5*[None], 10)

# this is now a fixed list of 10 items.
# by appending more items, you'd be 
# dropping items from the beginning

fixed_list.append(1)
print(fixed_list)

This is a short article, mostly to record something I see a lot of junior developers try to implement themselves.