Skip to content

Correctly classify builtin static and class methods #76446

Closed

Description

@serhiy-storchaka
BPO 32265
Nosy @serhiy-storchaka, @1st1
PRs
  • bpo-32265: Classify class and static methods of builtin types. #4776
  • 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 = <Date 2017-12-15.12:14:40.293>
    created_at = <Date 2017-12-09.22:54:10.274>
    labels = ['3.7', 'type-feature', 'library']
    title = 'Correctly classify builtin static and class methods'
    updated_at = <Date 2017-12-15.12:14:40.292>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-12-15.12:14:40.292>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-12-15.12:14:40.293>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2017-12-09.22:54:10.274>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32265
    keywords = ['patch']
    message_count = 2.0
    messages = ['307928', '308389']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'yselivanov']
    pr_nums = ['4776']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue32265'
    versions = ['Python 3.7']

    Activity

    1. serhiy-storchaka commented on Dec 9, 2017

      @serhiy-storchaka
      MemberAuthor

      Currently class and some static methods of builtin types are classified as plain methods. The proposed patch adds types.ClassMethodDescriptorType for unbound class methods of builtin types and makes inspect.classify_class_attrs() correctly classifying static and class methods of builtin types. This results in changing the help() output.

      All __new__ methods now are classified as static.

      Examples of class methods are dict.fromkeys and int.from_bytes.

    2. added
      3.7 (EOL)
      stdlib
      type-feature
      on Dec 9, 2017
    3. serhiy-storchaka commented on Dec 15, 2017

      @serhiy-storchaka
      MemberAuthor

      New changeset 3327a2d by Serhiy Storchaka in branch 'master':
      bpo-32265: Classify class and static methods of builtin types. (bpo-4776)
      3327a2d

    4. transferred this issue fromon Apr 10, 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.7 (EOL)stdlibtype-feature

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions