News for hackers. Stuff that matters.
Re:DotDict: A simple Python library to make chained attribut... by samwillis on Wednesday August 02, 2023 @06:20PM (#36978546)
They could add a __bool__ method to the class the returns false when that level of the namespace is empty. That would allow:

   if a.b.c:
       print("c:", a.b.c)
Re:DotDict: A simple Python library to make chained attribut... by rozab on Wednesday August 02, 2023 @06:25PM (#36978605)
The __contains__ method should be used (and indeed is). What if a.b.c = False?