@PythOnRails to Python • 10 months agoThe Python dictionary dispatch patternjamesg.blogexternal-linkmessage-square10arrow-up133arrow-down10cross-posted to: [email protected]
arrow-up133arrow-down1external-linkThe Python dictionary dispatch patternjamesg.blog@PythOnRails to Python • 10 months agomessage-square10cross-posted to: [email protected]
minus-square@[email protected]linkfedilink2•10 months agoBroadly, this is a simple version of the Strategy Pattern, which is incredibly useful for making flexible software. In Python, the example given is basically the classic bodge attempt to emulate switch-case statements.
Broadly, this is a simple version of the Strategy Pattern, which is incredibly useful for making flexible software.
In Python, the example given is basically the classic bodge attempt to emulate switch-case statements.