2010/8/23 Raymond Hettinger <raymond.hettinger at gmail.com>: > I don't have a specific proposal in mind. My main questions are > * Is there anything that hasattr(obj, key) can or should do that > can't already be done with getattr(obj, key, None)? > If not, do we really need to change anything? For one, it's annoying when "key" can be None. > * Why do people typically use hasattr() instead getattr()? > Aren't they are really trying to just determine > whether a key exists somewhere in the MRO? > If so, then doing anything more than that is probably a surprise. It's generally more convenient that getattr(obj, "blah", None) is not None. > > P.S. The current behavior seems to be deeply embedded: Well, that's what happens when a behavior is added in 1990. :) -- Regards, Benjamin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4