
Sorry, none of your proposals (Droppable, Potential, NotRequired, Open, or another metaclass flag) sound right to me. We don't have an inverse of Optional -- why would we need an inverse of Required? The only objection to Required I can think of is actually that it *sounds* like the inverse of Optional, which it isn't. Then again, Optional should have been named Nullable from the beginning, but it's too late to change it now. On Tue, Jan 5, 2021 at 12:36 AM Tuukka Mustonen <tuukka.mustonen@gmail.com> wrote:
3) One more suggestion:
class MyThing(TypedDict, optional_types_may_be_missing=True): req1: int opt1: Optional[str]
This would allow `Optional` fields to be also missing. It would not work when you want a field, that can be missing, but if present, is not allowed to have `None` as value. I would expect that to be rare (but still a requirement for some).
Obviously a better name would be needed for the parameter. Maybe `allow_missing`, `missing`, `strict=False` etc. _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: guido@python.org
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>