-
Notifications
You must be signed in to change notification settings - Fork 286
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
PEP 484 type checking #523
base: master
Are you sure you want to change the base?
Conversation
Hi, it would be great to have some feedback on this. Namely, whether it is acceptable to add |
I agree with you, adding |
@lkraider glad to hear it. Question: What is the state of the deprecated mixins? I see in Should |
Here's the code I'm referring to: https://github.com/schematics/schematics/blob/master/schematics/types/compound.py#L154 You'll notice that model_class.convert(value, context=context) ... whereas export_loop(model_class, value, context=context) Should this be |
I have not yet gone through the compound types. My idea was to phase out the compatibility mixins at the same time move the Model fields into state-machines that keep their own info of whether they are already validated or not. The plan is to free us from having to pass the model around everywhere. But that is still only in the idea phase. For now, the mixins try to make sure a Model is equivalent to a Schema, eventually we want only the Schema going around. |
Hi, I had some time to hack away at this some more. It's going to be a long process, so we should try to break it up into smaller tasks that can be merged as we go. The first of these tasks that I've encountered, which I could use someone else's help on, is converting use of |
Yes let's do it. I am not a fan of the star import myself, but I think we should curate the exports. |
Cool, any chance you can help me out with that? Maybe the simplest thing to do is hack |
Sure thing, I plan on working this weekend on the release, and I'll also work on the exports then. |
I've made the changes to the master branch, let me know if it works this way. |
Did this die on the vine? |
Bump - would be very keen on having schematics typing for both schematics models and primitives (some form of typed_dict). |
Related to: #522
I understand the desire to avoid adding
typing
as a requirement, but doing so does open up some powerful options that are not otherwise available:Generic
classesNamedTuple
@overloads
I demonstrated the use of some of these in this commit. Let me know what you think.