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.
> 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.