Skip to content

Minor docstring improvement in __contains__ #89682

Closed

Description

@ivanistheone
BPO 45519
Nosy @ivanistheone
PRs
  • gh-89682: [doc] reword docstring of __contains__ to clarify that it returns a bool #29043
  • 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 = None
    created_at = <Date 2021-10-18.22:49:58.485>
    labels = ['3.7', '3.8', '3.9', '3.10', '3.11', 'type-feature', 'docs']
    title = 'Minor docstring improvement in __contains__'
    updated_at = <Date 2021-10-18.23:00:33.943>
    user = 'https://github.com/ivanistheone'

    bugs.python.org fields:

    activity = <Date 2021-10-18.23:00:33.943>
    actor = 'Ivan.Savov'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2021-10-18.22:49:58.485>
    creator = 'Ivan.Savov'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45519
    keywords = ['patch']
    message_count = 1.0
    messages = ['404236']
    nosy_count = 2.0
    nosy_names = ['docs@python', 'Ivan.Savov']
    pr_nums = ['29043']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue45519'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']

    Activity

    1. ivanistheone commented on Oct 18, 2021

      ivanistheonemannequin
      MannequinAuthor

      Currently,

      >>> help(list.__contains__)
      

      returns

      Help on wrapper_descriptor:
      __contains__(self, key, /)
          Return key in self.
      

      Which is a conceptual circular reference,
      since in is implemented by __contains__.

      Changing the help string to

      "Return True if key in self."

      would fix this.

    2. transferred this issue fromon Apr 10, 2022
    3. added a commit that references this issue on Nov 26, 2022
    4. added
      3.12only security fixes
      and removed
      3.11only security fixes
      on Nov 26, 2022
    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

      3.12only security fixesdocsDocumentation in the Doc dirtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions