On Tue, Oct 26, 2021, 1:08 PM Chris Angelico <[email protected]> wrote:
> No, I agree. We have to still be able to introspect them.
>
> At the moment, when you look at a function's defaults, they are all
> values. With this change, some would be values and some would be markers
> saying that code would be executed.
>
So why on earth NOT make these general "deferred" objects that can be used
in other contexts?!
Effectively that's what you need them to be. Going out of your way to make
sure they aren't used outside function signatures seems backwards.
I used the construct `defer: some_code`. Marc-André spells it without the
colon. I think now I like his better, but was initially emphasizing the
similarities with lambda. Punctuation would be fine too.
But the general idea is that a first class object is more useful, whether
it's spelled:
do_later = defer: foo(bar(baz))
do_later = defer foo(bar(baz))
do_later = $( foo(bar(baz)) )
Or some other way... I actually don't hate the bash-inspired punctuation as
much as I'm sure everyone else will... But I really just mean to suggest
"some punctuation."
>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/WPMNFBJK7TVRX42FD3B5MAMU4JHZX6B6/
Code of Conduct: http://python.org/psf/codeofconduct/