[Python-ideas] Null coalescing operator
Pavol Lisy
pavol.lisy at gmail.com
Wed Nov 2 18:59:41 EDT 2016
More information about the Python-ideas mailing list
Wed Nov 2 18:59:41 EDT 2016
- Previous message (by thread): [Python-ideas] Null coalescing operator
- Next message (by thread): [Python-ideas] Null coalescing operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/15/16, Nick Coghlan <ncoghlan at gmail.com> wrote: > * None-coalescing operator: x ?or y > * None-severing operator: x ?and y > * None-coalescing augmented assignment: x ?= y > * None-severing attribute access: x?.attr > * None-severing subscript lookup: x?[expr] Please don't be too harsh to me for my next words! :) Just to trying to find something more cool (at least for young people :P ) I was thinking about emoticons... :( (means I am not happy because left is None) But parenthesis would be too confusing with "real" parenthesis. Example: (x :( (a + b)) # and editor would have problem to find corresponding pairs of parenthesis! So I am just trying to replace parenthesis with <> and playing with it * None-coalescing operator: x :< y * None-severing operator: x :> y * None-coalescing augmented assignment: x =< y * None-severing attribute access: x.>attr * None-severing subscript lookup: x[>expr] # ok this one seems a little weird to me too alternatively: x:>[expr] With this syntax/paradigm we could have also: * None-severing augmented assignment: x => y About spelling: we could say None-coalescing and None-severing operator in theory and sad and happy operator in real life. :) PL.
- Previous message (by thread): [Python-ideas] Null coalescing operator
- Next message (by thread): [Python-ideas] Null coalescing operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list