Skip to content

Docs erroneously say that odict.add() only has two mandatory parameters #554

Closed
@alexwlchan

Description

@alexwlchan

Quoting from the Extension API docs (emphasis mine):

The add() method accepts three arguments:

  • key: A string. The key is used for later reference to the item.
  • value: The object instance stored in this item.
  • location: Optional. The items location in relation to other items.

But the source code for the method shows that all three arguments are required:

def add(self, key, value, location):
    """ Insert by key location. """

Either the "Optional" should be removed from the docs, or the parameter should be made optional.

I’d mildly prefer the latter, as I have some cases where the location really doesn’t matter, but it’s not a strong preference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions