Skip to content

Should csv.DictWriter require fieldnames to be a Sequence? #5993

Closed

Description

@PeterJCLaw

I realise that according to the docs the fieldnames parameter to DictWriter should be a sequence, however code which doesn't actually pass a sequence (instead perhaps passing dict.keys()) does in fact work and may have a well-defined key ordering.

Should the typeshed record what actually works or closely match the docs?
(Should the docs be updated?)

Activity

  1. srittau commented on Sep 1, 2021

    @srittau
    Collaborator

    Generally, we prefer to follow the implementation, not the docs in typeshed.

  2. added a commit that references this issue on Sep 2, 2021
    425a353
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions