PEP 505 proposes to use ? and ?? as new syntax element to create compact expressions dealing with identifiers that could have a value of None.
maybe() from sorcery as well as maybe() from pymaybe appear to have implemented a similar functionality through function calls instead of the proposed and currently invalid Python syntax described in PEP 505.
It might be possible to write an import hook that would convert the proposed syntax into calls to one of the existing maybe() functions, thus allowing one to experiment with the proposed syntax.
PEP 505 proposes to use
?
and??
as new syntax element to create compact expressions dealing with identifiers that could have a value ofNone
.maybe()
from sorcery as well asmaybe()
from pymaybe appear to have implemented a similar functionality through function calls instead of the proposed and currently invalid Python syntax described in PEP 505.It might be possible to write an import hook that would convert the proposed syntax into calls to one of the existing
maybe()
functions, thus allowing one to experiment with the proposed syntax.