Skip to content

Document callables more explicitly #123392

@ryan-duve

Description

@ryan-duve

Documentation

Currently, some options that expect callables read like this in the documentation:

json.load(...)

parse_constant, if specified, will be called with one of the following strings: '-Infinity', 'Infinity', 'NaN'. This can be used to raise an exception if invalid JSON numbers are encountered.

One potentially confusing interpretation of the above is "if parse_constant is specific, then json.load will be called with...". It would be clearer if these were documented like the object_hook parameter right above it:

object_hook is an optional function that will be called with the result...

This issue is being opened to tag a PR to that updates the documentation in this module like this:

<param>, if specified, will be called  ---->  <param> is an [optional] function that will be called

The goal is for the documentation to be more consistent and less likely for a user to misinterpret what will be called.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions