GrahamDumpleton / wrapt

A Python module for decorators, wrappers and monkey patching.
BSD 2-Clause "Simplified" License
2.04k stars 230 forks source link

ObjectProxy.__annotations__ typo references "self.__wrapped__.__anotations__" #127

Closed austinrogers closed 4 years ago

austinrogers commented 5 years ago

In wrapt.wrappers.ObjectProxy:

@property
def __annotations__(self):
    return self.__wrapped__.__anotations__

Needs to be:

@property
def __annotations__(self):
    return self.__wrapped__.__annotations__
GrahamDumpleton commented 5 years ago

Sorry for slow reply. Been away on two overseas trips and only just now catching up.

I really don't understand why the tests weren't picking this up. I think because it was raising an AttributeError, it would fall back to looking up the attribute on wrapped function using generic __getattr__ on the proxy object.

Were you seeing a specific error, or did you just happen to see the mistake when reading the code?