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

Check fields #203

Closed
dblock opened this issue Sep 15, 2021 · 1 comment
Closed

Check fields #203

dblock opened this issue Sep 15, 2021 · 1 comment

Comments

@dblock
Copy link

dblock commented Sep 15, 2021

Is your feature request related to a problem? Please describe.

This is similar to #161. I have a class that wraps some YAML being loaded and want to make sure I get strings as opposed to floats for values such as 1.1. My users forget to quote them all the time.

    @typechecked
    class Component:
        val: str

        def __init__(self, data):
            self.val = data["val"]

Describe the solution you'd like
Would like the above to raise an error when val=1.1 and pass when val='1.1'.

@dblock
Copy link
Author

dblock commented Sep 15, 2021

Actually the solution in #161 works.

@dblock dblock closed this as completed Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant