Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I remember reading about the interface for making a class act as a boolean the last time I messed with Python. I thought it was neat that you could make any object act as a boolean, function, whatever. I can't seem to find the docs for it though.


I believe this is what you're talking about:

http://docs.python.org/py3k/reference/datamodel.html#object....


That's the one. Thanks.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: