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

[typing] TypedDict's 'total' argument is undocumented #83753

Closed
brettcannon opened this issue Feb 6, 2020 · 12 comments
Closed

[typing] TypedDict's 'total' argument is undocumented #83753

brettcannon opened this issue Feb 6, 2020 · 12 comments
Labels
3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir easy

Comments

@brettcannon
Copy link
Member

BPO 39572
Nosy @gvanrossum, @brettcannon, @ilevkivskyi, @miss-islington, @ananthan-123
PRs
  • bpo-39572:documented _total_ attribute of TypedDict #18554
  • [3.8] bpo-39572: Document ’total’ flag of TypedDict (GH-18554) #18556
  • bpo-39572: Address typo in CHANGELOG. #24999
  • [3.9] bpo-39572: Address typo in CHANGELOG. (GH-24999) #25545
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-02-19.05:28:20.370>
    created_at = <Date 2020-02-06.20:08:00.422>
    labels = ['easy', '3.8', '3.9', 'docs']
    title = "[typing] TypedDict's 'total' argument is undocumented"
    updated_at = <Date 2021-04-23.00:58:50.021>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2021-04-23.00:58:50.021>
    actor = 'miss-islington'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-02-19.05:28:20.370>
    closer = 'gvanrossum'
    components = ['Documentation']
    creation = <Date 2020-02-06.20:08:00.422>
    creator = 'brett.cannon'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39572
    keywords = ['patch', 'easy']
    message_count = 12.0
    messages = ['361503', '362228', '362229', '362231', '362232', '362247', '362251', '362252', '362262', '362276', '391643', '391645']
    nosy_count = 7.0
    nosy_names = ['gvanrossum', 'brett.cannon', 'docs@python', 'python-dev', 'levkivskyi', 'miss-islington', 'Ananthakrishnan']
    pr_nums = ['18554', '18556', '24999', '25545']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39572'
    versions = ['Python 3.8', 'Python 3.9']

    @brettcannon
    Copy link
    Member Author

    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. ;)

    @brettcannon brettcannon added 3.8 only security fixes 3.9 only security fixes labels Feb 6, 2020
    @brettcannon brettcannon added the docs Documentation in the Doc dir label Feb 6, 2020
    @ananthan-123
    Copy link
    Mannequin

    ananthan-123 mannequin commented Feb 18, 2020

    @ananthan-123
    Copy link
    Mannequin

    ananthan-123 mannequin commented Feb 18, 2020

    It will be usefull if we document _total_ argument also.

    @gvanrossum
    Copy link
    Member

    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?

    @ananthan-123
    Copy link
    Mannequin

    ananthan-123 mannequin commented Feb 18, 2020

    yes,I'm interested.

    @gvanrossum
    Copy link
    Member

    New changeset ab6423f by ananthan-123 in branch 'master':
    bpo-39572: Document ’total’ flag of TypedDict (GH-18554)
    ab6423f

    @miss-islington
    Copy link
    Contributor

    New changeset 44c6901 by Miss Islington (bot) in branch '3.8':
    bpo-39572: Document ’total’ flag of TypedDict (GH-18554)
    44c6901

    @gvanrossum
    Copy link
    Member

    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. :-)

    @ananthan-123
    Copy link
    Mannequin

    ananthan-123 mannequin commented Feb 19, 2020

    yes,I'm interested in writing docs for the __required_keys__ and __total_keys__ attributes.

    @gvanrossum
    Copy link
    Member

    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)

    @miss-islington
    Copy link
    Contributor

    New changeset 6afb0a8 by Simon Charette in branch 'master':
    bpo-39572: Address typo in CHANGELOG. (GH-24999)
    6afb0a8

    @miss-islington
    Copy link
    Contributor

    New changeset bc5a1a7 by Miss Islington (bot) in branch '3.9':
    bpo-39572: Address typo in CHANGELOG. (GH-24999)
    bc5a1a7

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir easy
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants