[Python-ideas] Runtime assertion with no overhead when not active

Steven D'Aprano steve at pearwood.info
Thu May 10 07:47:44 EDT 2018

On Thu, May 10, 2018 at 08:55:44AM +0100, Barry Scott wrote:

> This idea requires the same sort of machinery in python that I was 
> hoping for to implement the short circuit logging.

I'm working on an idea for delayed evaluation of expressions, and I 
think your idea of logging below would make an excellent use-case.

> My logging example would be
> 	log( control_flag, msg_expr )
> expanding to:
> 	if <control_flag>:
> 		log_function( <msg_expr> )

The idea isn't yet ready for Python-Ideas, but if you're interested feel 
free to contact me off-list.


More information about the Python-ideas mailing list