Two types ring buffer implemented by Python