Skip to content

Documented parameter names of some email.utils functions don't match the implementation #161816

Open

Description

@thejesh23

Documentation

A few functions in the email.utils docs show a parameter name that differs from the real one. Anyone copying the name from the docs gets a TypeError:

>>> from email.utils import parsedate
>>> parsedate(date='Mon, 20 Nov 1995 19:12:08 -0500')
TypeError: parsedate() got an unexpected keyword argument 'date'. Did you mean 'data'?
>>> parsedate(data='Mon, 20 Nov 1995 19:12:08 -0500')
(1995, 11, 20, 19, 12, 8, 0, 1, -1)
Function Docs Code
parseaddr() address addr
parsedate(), parsedate_tz(), parsedate_to_datetime() date data
mktime_tz() tuple data

Linked PRs

Activity

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