News for hackers. Stuff that matters.
Re:Python adopts a 12-month release cycle by ben509 on Saturday November 02, 2019 @03:22AM (#21426338)
These two are syntactically equal and in Python there's no way a linter can distinguish between these two:

    if reductor = dispatch_table.get(cls):
    if reductor == dispatch_table.get(cls):
A human being can only distinguish them through careful inspection. The walrus operator not only prevents that problem, but makes the intent unambiguous.

> Not sure why there's a need to reinvent a wheel for basically zero gain.

What's being reinvented? No one claimed this was an original idea. It's just inline assignment with a syntactic tweak to prevent a well known problem.

There are no comments on this comment yet.