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

Deprecate the @customtype decorator #15

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

illright
Copy link
Collaborator

I don't think it's necessary to set attributes for type-checking functions or decorate them in any way.

I've kept the @customtype decorator for backwards compatibility, but the __datatyping_validate attribute is no longer checked. Now any callable is accepted as a type checker.

I've also refactored the code a bit.

Let me know what you think about this change.

@carlbordum
Copy link
Owner

I added customtype, because the syntax for type structures - while easy and readable - doesn't allow you to express very simple things.

How would I verify that a list only contains 1 integer after this patch?

@carlbordum
Copy link
Owner

Okay, I see what you're doing with callables. Ill think about it, but may not be available before next weekend.

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

Successfully merging this pull request may close these issues.

2 participants