[Python-ideas] Using `or?` as the null coalescing operator

Koos Zevenhoven k7hoven at gmail.com
Mon Sep 28 12:50:15 CEST 2015


On Mon, Sep 28, 2015 at 10:13 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 25 September 2015 at 09:07, Alessio Bogon <youtux at gmail.com> wrote:
>> I really like PEP 0505. The only thing that does not convince me is the `??` operator. I would like to know what you think of an alternative like `or?`:
>>
>> a_list = some_list or? []
>> a_dict = some_dict or? {}
>>

And have the following syntax options been considered?

a_list = some_list else []

a_list = some_list or [] if None

-- Koos


More information about the Python-ideas mailing list