PythOnRails@programming.dev to Python@programming.dev · 1 year agoThe Python dictionary dispatch patternjamesg.blogexternal-linkmessage-square10fedilinkarrow-up133cross-posted to: hackernews@derp.foo
arrow-up133external-linkThe Python dictionary dispatch patternjamesg.blogPythOnRails@programming.dev to Python@programming.dev · 1 year agomessage-square10fedilinkcross-posted to: hackernews@derp.foo
minus-squareDigitalWebSlinger@lemmy.worldlinkfedilinkarrow-up2·1 year 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.