Oops I forgot that this could evaluate to a set if “a” was defined beforehand. Maybe not a good idea after all. It’s not a good idea to use a mutable object anyways a default value. > On 24 Oct 2021, at 4:57 PM, Abdulla Al Kathiri <[email protected]> > wrote: > > How about this syntax: > > def insort_right(a, x, lo=0, hi={len(a)}, *, key=None): … > > Similar to the expression curly brackets in f-string. If the user didn’t > specify a value for hi, the expression between the curly brackets will be > evaluated and assigned to hi. > Abdulla > > Sent from my iPhone > >> On 24 Oct 2021, at 4:46 PM, Ricky Teachey <[email protected]> wrote: >> >> >> It seems to me that the syntax for late binding could be chosen so as to >> leave the possibility of expansion open in the future, and defer (har har) >> the entire generalized thunk discussion? >> >> So why not go with syntax like this, where before the ? just represents a >> keyword to be bike shedded ("defer", "thunk", "later", "...."): >> >> def func(a, b=? a): ... >> >> I kind of like using the ellipses btw; it looks sort of like "later..." to >> me: >> >> def func(a, b = ... a): >> ... >> >> _______________________________________________ >> 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/3F2I2N3OO2M34XYOR4SKCA2KQ4FFJBOK/ >> Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________ 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/Z5CQH4VMT6GNX73IQ3ZVB6FW5FQXR7WZ/ Code of Conduct: http://python.org/psf/codeofconduct/
