Skip to content

Decorator syntax for type casting in decorators #490

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

Closed
wants to merge 1 commit into from
Closed

Decorator syntax for type casting in decorators #490

wants to merge 1 commit into from

Conversation

emmeowzing
Copy link

@emmeowzing emmeowzing commented Oct 29, 2017

I don't know if this is the proper way to write this, but I was writing a decorator and thought, wait, if I can use functools.wraps as a decorator, why can't I use typing.cast as a decorator? I understand it's meant to be as fast as possible, but I'm sure decorating as in the following kind of way wouldn't slow things down too much. Also, I'm really just hoping to start the discussion, because I haven't been able to find anything about it on GitHub or by Googling.

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@ilevkivskyi
Copy link
Member

Thanks! I think this looks like a duplicate of something already being discussed @declared_type, see python/peps#242 and python/mypy#3291. Normally, opening an issue before a PR would save some efforts.

@emmeowzing
Copy link
Author

Okay I'll remember that next time!

@ilevkivskyi
Copy link
Member

I am closing this since since this still needs discussion (which can continue in the issues mentioned in my previous comment).

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

Successfully merging this pull request may close these issues.

3 participants