On Mon, Oct 25, 2021 at 7:51 PM Barry Scott <ba...@barrys-emacs.org> wrote:
>
> Clarification please:
>
> What is the bytecode that will be generated?

Equivalent to:

if argument not provided:
    argument = <expr>

except that we don't have a way of saying "not provided".

> Does the bytecode only run the default code if the argument is missing?

Yes. It is for default values, not for transforming.

> And missing is not the same as is None?

Most assuredly not - that's part of the point. The semantics are
closer to the "dedicated sentinel" idiom, but there is no value which
can be passed which triggers this.

> Also have you add the @var=default suggestion from Stephen to the syntax 
> options.
> I'm +1 on the @ syntax as it is easier to pick up on and the other reasons 
> that Stephen
> provided.

Not really a fan, but I guess I can add it as an alternative.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/NLAYWMGR5O27VH4CA4IMFFYPFH4CCFW2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to