Skip to content
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

Correctly classify builtin static and class methods #76446

Closed
serhiy-storchaka opened this issue Dec 9, 2017 · 2 comments
Closed

Correctly classify builtin static and class methods #76446

serhiy-storchaka opened this issue Dec 9, 2017 · 2 comments
Labels
3.7 stdlib type-feature

Comments

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 9, 2017

BPO 32265
Nosy @serhiy-storchaka, @1st1
PRs
  • #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']

    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented Dec 9, 2017

    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.

    @serhiy-storchaka serhiy-storchaka added 3.7 stdlib type-feature labels Dec 9, 2017
    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented Dec 15, 2017

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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 stdlib type-feature
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant