hynek / prometheus-async

Async Python helpers for the official prometheus-client.
https://prometheus-async.readthedocs.io/
Apache License 2.0
163 stars 15 forks source link

Second attempt at implementing decorators ourselves #26

Closed hynek closed 2 years ago

hynek commented 2 years ago

Based on help by Anthony Sottile, still breaks instances though.

hynek commented 2 years ago

So I think I've got time with the help of https://github.com/GrahamDumpleton/wrapt/blob/master/blog/02-the-interaction-between-decorators-and-descriptors.md#wrappers-as-descriptors

I don't think we need the extra wrapping of the callable.

hynek commented 2 years ago

Reading on, it seems like there’s complexities around update_wrapper and bound methods. We’ll just keep using wrapt and I’ve gotta say that Python decorators are a much worse minefield than I thought.