fix __contains__ method for infinite ranges