[Python-ideas] Re: Proposal for get_or function in Python dictionaries

2023-07-15 Thread Jothir Adithyan
> > Pythonistas have supported it. That PEP is a bigger lift than your > > suggestion, but correspondingly more general. > > On Mon, Jul 10, 2023, 6:04 PM Jothir Adithyan > mailto:adithyanjot...@gmail.com> wrote: > > Hi everyone, > > I would like to briefly p

[Python-ideas] Re: Proposal for get_or function in Python dictionaries

2023-07-15 Thread Jothir Adithyan
Chris Angelico wrote: > On Tue, 11 Jul 2023 at 08:05, Jothir Adithyan adithyanjot...@gmail.com wrote: > > Assumptions: > > The problem statement is based on a few assumptions: > > > > You prefer chaining `get` statements for cleaner code. > > You expect at l

[Python-ideas] Re: Proposal for get_or function in Python dictionaries

2023-07-15 Thread Jothir Adithyan
Not to create them in the first place (if it depends on you) > 2. Or simply: (dict.get(‘k1’) or dict()).get(‘child_key') > > On 10 Jul 2023, at 22:18, Jothir Adithyan adithyanjot...@gmail.com wrote: > > Hi everyone, > > I would like to briefly present my idea regardin

[Python-ideas] Proposal for get_or function in Python dictionaries

2023-07-10 Thread Jothir Adithyan
g to reveal itself in the dark. Thank you for taking the time to read this thread. Your feedback is greatly appreciated. Best regards, Jothir Adithyan **Runnable Version** https://replit.com/@Adithyan71/GetOr **Code Samples.** ``` class PlayDict(dict):     def g