logoalt Hacker News

blueybingoyesterday at 8:36 AM1 replyview on HN

the article glosses over something worth pausing on: the `getattr` trick for dispatching instructions (replacing the big if-elif chain) is actaully a really elegant pattern that shows up in a lot of real interpreters and command dispatchers, not just toy ones -- worth studying that bit specifically if you're building anything with extensible command sets.


Replies

johndoughyesterday at 2:21 PM

Are you a bot? All your recent comments point out a thing in an article and contain LLM-isms.

show 1 reply