PEP new assert idiom
niels_bohr at uol.com.br
Sun Nov 7 09:04:22 CET 2004
Em Sáb, 2004-11-06 às 22:48 -0800, Paul Rubin escreveu:
> "Raymond Hettinger" <vze4rx4y at verizon.net> writes:
> > Why do you need a statement for this?
> > IMO, a plain function will do the trick:
> I do write such functions sometimes, but using a statement is more
> natural. That's why the assert statement exists, for example.
> Because of that naturalness, the temptation to misuse the assert
> statement is very great, and I find myself doing it all the time
> thinking I'll clean it up later. So I think having a statement for
> runtime checking would be in the correct spirit.
If it wasn't that we should be programming in assembly as it's faster :)
AFAIK all real world programming languages are turing equivalent, so
sugar is what differentiates on of the other. I'd love to see that sugar
in Python since defining assert functions is distracting.
More information about the Python-list