On Thu, Mar 13, 2014 at 8:37 AM, Tres Seaver <tseaver at palladion.com> wrote: > On 03/12/2014 04:49 PM, Chris Angelico wrote: >> You can use hasattr() in place of AttributeError > > I use: > > getattr(subject, attrname, default)? > > *all the time*. Umm, yeah, that one. Why did I think hasattr was the only way around that? Anyway, that just means I picked a bad example. There are others where you have to go for the full try/except. ChrisA
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