Graham Dumpleton

Results 765 comments of Graham Dumpleton

Does `get_signature()` still return `None` if given a function which takes arguments? Is that we are using a function with no arguments a bad test case and it perhaps uses...

As example, if `__dict__` should resolve to that for wrapped object, would have: ``` import inspect, wrapt class Foo: pass class Bar(Foo, wrapt.ObjectProxy): @property def __dict__(self): return self.__wrapped__.__dict__ ``` For...

You are probably better off monkey patching the connection object instance because `sqlalchemy.inspect()` derives information from the direct type of an object and doesn't use `__class__` to lookup the type...

If have issues with type check, then you may also need to counter that `ObjectProxy` contains: ``` @property def __class__(self): return self.__wrapped__.__class__ @__class__.setter def __class__(self, value): self.__wrapped__.__class__ = value ```...

BTW, doing it this way you don't actually need `wrapt` as could use: ``` class Connection: def __enter__(self): print("Connection::__enter__()") return self def method(self): print("Connection::method()") def __exit__(self, exc_type, exc_value, exc_tb): print("Connection::__exit__()")...

Hmmm, wrapt doesn't specifically prohibit updating `__class__` on proxy objects and should pass it through, but my test earlier didn't work. Not sure why now.

Okay, so the pure Python implementation of `wrapt` allows updating `__class__` attribute, but the C implementation doesn't. I need to work out a fix for that if possible. Some things...

Nope, should be easy. I just don't provide a setter. Anyway, fixing that will still not help in this case.

I didn't know it had to be on the type either. I tried monkey patching the instance first as well. :-( So have no real idea why it is that...

Sorry for slow reply, was on holiday at the time and just catching up. As far as I can tell your implementation of `__get__()` is wrong as you don't check...