

@classdef.method('pop')
@check_frozen()
def method_pop(self, space, w_num=None):
    if (w_num is None):
        if self.items_w:
            return self.items_w.pop()
        else:
            return space.w_nil
    else:
        num = space.int_w(space.convert_type(w_num, space.w_fixnum, 'to_int'))
        if (num < 0):
            raise space.error(space.w_ArgumentError, 'negative array size')
        else:
            pop_size = max(0, (self.length() - num))
            res_w = self.items_w[pop_size:]
            del self.items_w[pop_size:]
            return pop_size.newarray(res_w)

dataset/ETHPy150Open topazproject/topaz/topaz/objects/arrayobject.py W_ArrayObject.method_pop/VarMisuse@153/202 `space`->`pop_size`