[SciPy-user] array like circular buffer?
skip at pobox.com
skip at pobox.com
Thu Oct 27 16:27:53 EDT 2005
John> I would like to have a fixed size array like data structure that
John> has circular buffer semantics. Eg, when empty you can call a
John> "put" method that starts in the beginning and fills the sucker up,
John> and when you overflow the end it starts pushing the data from the
John> 0 index off the stack -- FIFO. Ideally, it would support slicing
John> and friends.
How about subclassing list and proving relevant methods that adjusted all
indices by modulo the list length?
Skip
More information about the SciPy-User
mailing list