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

Support custom data descriptors in pydoc #79800

Closed
serhiy-storchaka opened this issue Dec 30, 2018 · 2 comments
Closed

Support custom data descriptors in pydoc #79800

serhiy-storchaka opened this issue Dec 30, 2018 · 2 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 35619
Nosy @rhettinger, @serhiy-storchaka
PRs
  • bpo-35619: Improve support of custom data descriptors in help() and pydoc. #11366
  • bpo-35619: Improve support of custom data descriptors in help() and pydoc. #11366
  • bpo-35619: Improve support of custom data descriptors in help() and pydoc. #11366
  • 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 2019-01-15.08:59:54.086>
    created_at = <Date 2018-12-30.17:48:44.494>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Support custom data descriptors in pydoc'
    updated_at = <Date 2019-01-15.08:59:54.086>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2019-01-15.08:59:54.086>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-01-15.08:59:54.086>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2018-12-30.17:48:44.494>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35619
    keywords = ['patch', 'patch', 'patch']
    message_count = 2.0
    messages = ['332753', '333651']
    nosy_count = 2.0
    nosy_names = ['rhettinger', 'serhiy.storchaka']
    pr_nums = ['11366', '11366', '11366']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35619'
    versions = ['Python 3.8']

    @serhiy-storchaka
    Copy link
    Member Author

    Currently pydoc supports only limited set of data descriptors: builtin member and getset descriptors (this covers slot descriptors and structseq member descriptors) and properties. But it does not fully support custom data descriptors.

    For example, after implementing accelerators for namedtuple fileds access in bpo-32492, if P = namedtuple('P', 'x y'), help(P.x) will output the help for the _tuplegetter class instead of the P.x member.

    The proposed PR replaces checks for particular types of data descriptors with a general check. It performs also some refactoring and adds a bunch of tests.

    @serhiy-storchaka serhiy-storchaka added 3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Dec 30, 2018
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset efcf82f by Serhiy Storchaka in branch 'master':
    bpo-35619: Improve support of custom data descriptors in help() and pydoc. (GH-11366)
    efcf82f

    @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.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant