- When doing the opposite of an action I would use the antonym of the method name. So in this case I would rename
erase_value
todelete
,remove
or another antonym of "add". - The
_first
suffix looks redundant -pop
andpeek
are common names for what you are doing. - A common pattern for first and second parameters like in
_swap_indexes
or your lambdas is simplyfirst
andsecond
. These are lexicographically more distinct thanindex1
andindex2
, so it's much harder to confuse the two. - Your
_*_index
methods seem like they could be useful to someone using this class. I would remove the initial underscore and possibly make them@property
methods.