Skip to content

Minor docstring improvement in __contains__ #89682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ivanistheone mannequin opened this issue Oct 18, 2021 · 1 comment
Closed

Minor docstring improvement in __contains__ #89682

ivanistheone mannequin opened this issue Oct 18, 2021 · 1 comment
Labels
3.12 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@ivanistheone
Copy link
Mannequin

ivanistheone mannequin commented Oct 18, 2021

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']

    @ivanistheone
    Copy link
    Mannequin Author

    ivanistheone mannequin commented Oct 18, 2021

    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.

    @ivanistheone ivanistheone mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Oct 18, 2021
    @ivanistheone ivanistheone mannequin assigned docspython Oct 18, 2021
    @ivanistheone ivanistheone mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement 3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Oct 18, 2021
    @ivanistheone ivanistheone mannequin assigned docspython Oct 18, 2021
    @ivanistheone ivanistheone mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Oct 18, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @iritkatriel iritkatriel added 3.12 only security fixes and removed 3.11 only security fixes 3.10 only security fixes 3.9 only security fixes 3.8 (EOL) end of life 3.7 (EOL) end of life labels Nov 26, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.12 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant