Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions with synchronized decorator doesn't preserved its typing signature #230

Open
alonp123 opened this issue Feb 25, 2023 · 1 comment

Comments

@alonp123
Copy link

I'm using the amazing wrapt.synchronized decorator, but I've just realized that it breaks the typing signature of the wrapped function (using vscode).
I tested it with custom wrapt.decorator function and it works fine.
Does someone have a solution?

Example:

import wrapt 

@wrapt.decorator
def pass_through(wrapped, instance, args, kwargs):
    return wrapped(*args, **kwargs)

@pass_through
def function(arg):
    print(arg)

@wrapt.synchronized
def synced_function(arg):
    print(arg)

The function signature:

image

The synced_function signature:

image

@GrahamDumpleton
Copy link
Owner

See #164 and #225. I still haven't got to properly understanding the types annotation mechanism in order to integrate suggested change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants