News for hackers. Stuff that matters.
Re:Box – Python dictionary with dot notation by rak1507 on Friday December 17, 2021 @04:39PM (#29598662)
Not to be harsh but why would anyone ever use this? It's just some syntax sugar? (and over 3K loc... yikes)
Re:Box – Python dictionary with dot notation by jackbrookes on Friday December 17, 2021 @05:16PM (#29599042)
It's useful for APIs that return dictionaries that have a reliable structure
Re:Box – Python dictionary with dot notation by rak1507 on Friday December 17, 2021 @05:23PM (#29599106)
But.. why not use foo['bar'] vs foo.bar? Are the extra 3 characters so annoying you have to rely on a new library?
Re:Box – Python dictionary with dot notation by aqeelat on Friday December 17, 2021 @05:40PM (#29599233)
It might be useful for auto completion when you’re using versions older than 3.8 and can’t use TypedDict.
Re:Box – Python dictionary with dot notation by rak1507 on Friday December 17, 2021 @06:02PM (#29599404)
Auto completion? So saving a fraction of a second? Again... not sure I see the benefit here.
Re:Box – Python dictionary with dot notation by aqeelat on Friday December 17, 2021 @06:07PM (#29599432)
You do know that code completion is a selling feature for IDEs, right?
Re:Box – Python dictionary with dot notation by peakaboo on Saturday December 18, 2021 @09:41AM (#29604779)
Fraction of a second?

Maybe if you remember all the keys in your dictionary in your head. Otherwise you would have to look them up while coding if you don't have auto completion.

Re:Box – Python dictionary with dot notation by aqeelat on Friday December 17, 2021 @06:10PM (#29599452)
You know what .. I’ll need to give it a try before I can actually discuss it further. I don’t want my ignorance to cloud other people’s judgement.