Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
samwillis
on Aug 2, 2023
|
parent
|
context
|
favorite
| on:
DotDict: A simple Python library to make chained a...
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)
rozab
on Aug 2, 2023
[–]
The __contains__ method should be used (and indeed is). What if a.b.c = False?
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: