-
Notifications
You must be signed in to change notification settings - Fork 19
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
Total vs optional/NotRequired #96
Comments
Great to hear you're pleased with the project! Let's start by clarifying the concept of
the above indicates that the key is required while the value can be either int or none. Not the same thing as At the time of developing this project, the only option to define non required keys was to use I'm open to adopt the new syntax, but we'll need to perform some detective work to distinguish between keys that are non-required and those that are required but can be set to none. This task isn't straightforward due AWS documentation isn't always clear on this. |
Hello @MousaZeidBaker, Thanks a lot for the answer. I agree that For sure that's some long and difficult work (because of aws, and docs.....), and the intention is to give more of an idea :) I am glad it pleases you, you could close the issue if you want as I guess it will be part of future small improvements, or keep it open to keep track. Thanks again, |
First of all, thanks a lot for the typing! Really helpful.
Sorry for the (maybe) dumb question but could the TypeDict have optional keys instead of a
total=False
?As an S3Object, could always have some key but the value could be null ?
So
would become
else, it could also be
NotRequired
which indicates to python that the key can be not here (withouttotal=False
which makes all the keysNotRequired
)That would make code like below compliant with type checkers :
Thanks in advance and sorry if indeed all keys are optional then my question doesn't make sense.
The text was updated successfully, but these errors were encountered: