return2ozma@lemmy.world to Technology@lemmy.worldEnglish · 23 hours agoDeparting Meta staffer posts biting anti-AI video internally amid mass layoffswww.motherjones.comexternal-linkmessage-square55linkfedilinkarrow-up1432arrow-down16cross-posted to: Aii@programming.dev
arrow-up1426arrow-down1external-linkDeparting Meta staffer posts biting anti-AI video internally amid mass layoffswww.motherjones.comreturn2ozma@lemmy.world to Technology@lemmy.worldEnglish · 23 hours agomessage-square55linkfedilinkcross-posted to: Aii@programming.dev
minus-squaredreugeworst@lemmy.mllinkfedilinkEnglisharrow-up3·14 hours agoas someone who would also reach for a state machine when doing simple parsing… what’s the better alternative in python?
minus-squarelectricleopard@lemmy.worldlinkfedilinkEnglisharrow-up1·7 hours agoA loop and a data structure to hold the result of parsing. The data structure will have a state you can interrogate. No need to build a state machine to explicitly name each way the parsing can develop.
minus-squaredreugeworst@lemmy.mllinkfedilinkEnglisharrow-up1·3 hours agothat’s what I’d do for a state machine implementation too
as someone who would also reach for a state machine when doing simple parsing… what’s the better alternative in python?
A loop and a data structure to hold the result of parsing. The data structure will have a state you can interrogate. No need to build a state machine to explicitly name each way the parsing can develop.
that’s what I’d do for a state machine implementation too