On Sun, 23 May 2021 at 15:30, Thomas Grainger <[email protected]> wrote:
>
> seems a bit like https://www.python.org/dev/peps/pep-0505/
>
> eg `d?[1]?[0]`

No, I do not want to suppress the exception, only to have a way to
access a nested object in a complicate dict, for example a dict
generated by a JSON.

In your example,

d = {1: [42]}
d.get_deep(2, 0)
# KeyError: 2
d = None
d.get_deep(1, 0)
# AttributeError: 'NoneType' object has no attribute 'get_deep'


> _______________________________________________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at 
> https://mail.python.org/archives/list/[email protected]/message/ZKYLSYU7U673RX6XQLYBSC2HGEAO5NES/
> Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/5CPPV3VADIF57Y4PPVZROOHGX45I7U6D/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to