PythOnRails@programming.dev to Python@programming.dev · 1 年前The Python dictionary dispatch patternjamesg.blogexternal-linkmessage-square10fedilinkarrow-up132arrow-down10
arrow-up132arrow-down1external-linkThe Python dictionary dispatch patternjamesg.blogPythOnRails@programming.dev to Python@programming.dev · 1 年前message-square10fedilink
minus-squareSubArcticTundra@lemmy.mllinkfedilinkarrow-up4arrow-down1·1 年前I think a similar result might now be achievable with match statements
minus-squarekiwifoxtrot@lemmy.worldlinkfedilinkarrow-up1·1 年前Match only just came out in Python 3.10, so it doesn’t universally work. I think you implied that in your comment, so I wanted to add context for others.
minus-squareSubArcticTundra@lemmy.mllinkfedilinkarrow-up2·1 年前Oh, yes. I’m excited for the arrival of match. I’ve used it in rust and it’s very nifty and Pythonic
I think a similar result might now be achievable with match statements
Match only just came out in Python 3.10, so it doesn’t universally work. I think you implied that in your comment, so I wanted to add context for others.
Oh, yes. I’m excited for the arrival of match. I’ve used it in rust and it’s very nifty and Pythonic