Simple heap implementation in Python