This might be an advanced python technique that I'm not aware of, but why is there a private version of a function inside of the function? For example:
# Summon a card from deck to hand. Does not check validity rules.
def normal_summon(pf, player, cardind, fpos, cardfaceind=FACE_UP_ATK):
def _normal_summon():
pf.FIELD[player][fpos].insert(0, pf.HAND[player].pop(cardind))
pf.FIELD[player][fpos][0]["cardface"] = cardfaceind
pf.PREV_NORM_SUMMON = pf.ROUND_CNT
return pf.FIELD[player][fpos]
pf.AS.append(_normal_summon)
Inside of normal_summon(), we have _normal_summon(). Why is this?