Quick Start

Documentation

In C, Java, and many other languages, it’s possible to assign variables inside
of if or while condition statements. This is useful in allowing you to concisely
both assign the value, and check whether a condition is met.

This ability doesn’t exist in Python, because of the thought that when people
write something like:

ifrow=db.fetch_results():...

They may have actually meant:

ifrow==db.fetch_results():...

Personally, I have never made this mistake. It seems far more like a theoretical
mistake that could plausibly happen than one that actually happens and warrants
removing features, as was chosen in Python.

Anyways, the let function in this module gives you something very close to that
ability in other languages. A few examples:

iflet(name=longInstanceName.longAttributeName):...# Yes, db.fetch_results() should just return a generator. No, it doesn't.whilelet(results=db.fetch_results()):...iflet(count=len(nameValuePair))!=1:raiseException('Bad amount: {}'.format(count))