[issue39572] [typing] TypedDict's 'total' argument is undocumented

New submission from Brett Cannon <brett@python.org>: The docs mention __total__, but there's no mention of how to actually set that attribute, nor what it actually represents. P.S. https://github.com/python/cpython/blob/master/Lib/typing.py#L16 says TypedDict "may be added soon"; I think that's outdated. ;) ---------- assignee: docs@python components: Documentation messages: 361503 nosy: brett.cannon, docs@python, gvanrossum, levkivskyi priority: normal severity: normal stage: needs patch status: open title: [typing] TypedDict's 'total' argument is undocumented versions: Python 3.8, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Ananthakrishnan <ananthakrishnan15.2001@gmail.com> added the comment: https://stackoverflow.com/questions/58427394/what-is-the-meaning-of-total-du... questions about this. ---------- nosy: +Ananthakrishnan _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Change by Guido van Rossum <guido@python.org>: ---------- keywords: +easy _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Ananthakrishnan <ananthakrishnan15.2001@gmail.com> added the comment: It will be usefull if we document _total_ argument also. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Guido van Rossum <guido@python.org> added the comment: There's no __total__ argument, but there is a __total__ attribute. There are also (new in 3.9) __required_keys__ and __total_keys__ attributes. Are you interested in submitting a PR with the needed doc changes? ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Ananthakrishnan <ananthakrishnan15.2001@gmail.com> added the comment: yes,I'm interested. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Change by Ananthakrishnan <ananthakrishnan15.2001@gmail.com>: ---------- keywords: +patch pull_requests: +17935 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18554 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Guido van Rossum <guido@python.org> added the comment: New changeset ab6423fe2de0ed5f8a0dc86a9c7070229326b0f0 by ananthan-123 in branch 'master': bpo-39572: Document ’total’ flag of TypedDict (GH-18554) https://github.com/python/cpython/commit/ab6423fe2de0ed5f8a0dc86a9c707022932... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +17936 pull_request: https://github.com/python/cpython/pull/18556 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 44c690112d96a81fe02433de7900a4f8f9457012 by Miss Islington (bot) in branch '3.8': bpo-39572: Document ’total’ flag of TypedDict (GH-18554) https://github.com/python/cpython/commit/44c690112d96a81fe02433de7900a4f8f94... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Guido van Rossum <guido@python.org> added the comment: Separately, would you also be interested in writing docs for the `__total__` class attribute of TypedDict subclasses (3.8 and 3.9) and for the `__required_keys__` and `__total_keys__` attributes (only in 3.9)? (Sorry, there's no document you can crib these from. :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Ananthakrishnan <ananthakrishnan15.2001@gmail.com> added the comment: yes,I'm interested in writing docs for the `__required_keys__` and `__total_keys__` attributes. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Guido van Rossum <guido@python.org> added the comment: Go for it. Use the same bug number. On Wed, Feb 19, 2020 at 02:30 Ananthakrishnan <report@bugs.python.org> wrote:
Ananthakrishnan <ananthakrishnan15.2001@gmail.com> added the comment:
yes,I'm interested in writing docs for the `__required_keys__` and `__total_keys__` attributes.
----------
_______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________
-- --Guido (mobile) ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Change by Roundup Robot <devnull@psf.upfronthosting.co.za>: ---------- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +23757 pull_request: https://github.com/python/cpython/pull/24999 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 6afb0a8078ff3fc93adc4177565c56f820ca2880 by Simon Charette in branch 'master': bpo-39572: Address typo in CHANGELOG. (GH-24999) https://github.com/python/cpython/commit/6afb0a8078ff3fc93adc4177565c56f820c... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +24269 pull_request: https://github.com/python/cpython/pull/25545 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset bc5a1a7adf0d0154cb3f247da84146dd51997540 by Miss Islington (bot) in branch '3.9': bpo-39572: Address typo in CHANGELOG. (GH-24999) https://github.com/python/cpython/commit/bc5a1a7adf0d0154cb3f247da84146dd519... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39572> _______________________________________
participants (5)
-
Ananthakrishnan
-
Brett Cannon
-
Guido van Rossum
-
miss-islington
-
Roundup Robot