You probably already saw the syntax but it is not common in the "except"
part:
For example, the following:
catch_everything = True
try:
raise Exception()
except Exception if catch_everything else ():
print("Caught!")
It is the same as:
catch_everything = True
exception_to_catch = Excepti
Hi David, I read the PEP and I think it would be useful to expand the
Motivation and Examples sections.
While indeed Dask uses lazy evaluation to build a complex computation
without executing it, I don't think that it is the whole story.
Dask takes this deferred complex computation and *plans* h
On Wed, Jun 22, 2022 at 02:30:14PM -0400, David Mertz, Ph.D. wrote:
The difference is in composition of operations. I can write a dozen
zero-argument lambdas easily enough. But those are all isolated.
But basically, think about `x = (later expensive1() + later expensive2()) /
later expensive3(
On Wed, Jun 22, 2022 at 11:22:05PM +0100, Paul Moore wrote:
Hang on, did the PEP change? The version I saw didn't have a compute()
method, deferred objects were just evaluated when they were
referenced.
You are right, the PEP does not mention a compute() method but uses the
that term. I just
The proposal can be more tricker than one may think.
Leave aside the precision and width specification that f'{foo:02.f'}
can get.
Leave even aside the pattern match syntax.
Suppose the following pattern (to differentiate it from f-string
I'm going to use p-strings)
pattern = p"Your id is {id}