On Nov 6, 2016 7:32 PM, "Nathaniel Smith" <[email protected]> wrote:
>
> [...]
>
> Some other use cases:
>
> Log some complicated object, but only pay the cost of stringifying the
> object if debugging is enabled:
>
>     log.debug!(f"Message: {message_object!r}")

Would the log.debug implementation need to fetch the context to evaluate
the delayed expression (say by using sys._getframe) or would that be bound?
Is a frame necessary or just a (bound?) symbol table? Could a substitute be
provided by on evaluation?

Curious how this looks to the callee and what is possible.

Also what is the meaning (if desirable) of something like:

def debug!(...): pass

Persistent delayed calls? Delayed default arguments? Something else? Not
valid?
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to