twilio/flask-restful — pull request #155 by dougblack (2013-11-18 18:52:04+00:00)
Title: Check object properties

Fixes #140 by continuing to check an object's properties if it implements a custom `__getitem__` method and that doesn't satisfy the specified key.

For example, if we have a class that defines `__getitem__`:
```python
class Foo(object):
def __init__(self, foo):
self.foo = foo
def __getitem__(self, n):
if type(n) is int:
if n < 3:
return n
return IndexError
raise TypeError
```
And Flask-RESTful is trying to marshal it by asking for the `foo` property, it will currently fail because Flask-RESTful checks `__getitem__` and returns a default if that doesn't work.

This pull holds off on returning a default until it has also checked the objects properties.