07.05.18 20:52, Guido van Rossum пише:
He basically wants a macro so that

   runtime_assert(<expr>)

expands to

   if <controlling flag> and (<expr>):
       raise AssertionError

In Lisp this would be easy. :-)

Python is not Lisp (still). But there is the MacroPy project. And at end you always can use an external tool for code generation. For example the old good cpp.

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to