This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author asvetlov
Recipients John Belmonte, asvetlov, ncoghlan, njs, xtreak, yselivanov
Date 2019-07-25.11:29:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564054142.35.0.187042359567.issue37398@roundup.psfhosted.org>
In-reply-to
Content
I still think that iscoroutinefunction should not be used for async/sync decoration type autodetection.

A day ago stuck with a case when decorator used iscoroutinefunction() for separation but returned a regular function wrapper that returns awaitable in turn.

As a result, the transparent decorator which should not modify a decorated function signature cannot be applied twice, e.g.

@retry
@retry
async def fetch(): 
    ...

This is very confusing behavior, the obvious fix is providing `sync_retry` and `async_retry` decorators to never mix the behavior.

Seems very close to the problem discussed here.
History
Date User Action Args
2019-07-25 11:29:02asvetlovsetrecipients: + asvetlov, ncoghlan, njs, yselivanov, xtreak, John Belmonte
2019-07-25 11:29:02asvetlovsetmessageid: <1564054142.35.0.187042359567.issue37398@roundup.psfhosted.org>
2019-07-25 11:29:02asvetlovlinkissue37398 messages
2019-07-25 11:29:02asvetlovcreate