
I've been thinking of practical uses for this new None aware operator and although I really like the idea, I believe this may become too weird to use if some things are not taken care of. Are all of those things meant to work? (or am I just crazy?) -- assuming C#-like syntax: for el in re.match(foo, bar)?.groups() ?? []: print(el.upper()) ------ # Assuming this function for readability def is_useful(x): return x is not None if not foo?: # Should read like "not is_useful(foo)" print('foo is None') # With this syntax it is easier to correct all those pieces of code "if not x:" where it should be "if x is None:" if foo??: # A shorter version possibly meaning "foo ?? True" or "foo is None" print('foo is still None') ----- # Are operators other than [] and () allowed? bar = foo? + 1 # For "foo?.__add__(1)" it would work, but for the realistic # "type(foo)?.__add__(foo, 1)" it does not translate correctly bar = foo ?+ 1 # Another spelling. Is this any better?? bar = foo? / baz? / 2 # How would this work? '(foo / baz) / 2' or 'foo / (bar / 2)' ----- Also for correctness, the shouldn't the '?=' operator be '??='