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

inspect.isdatadescriptor false negative #76581

Closed
chnlior mannequin opened this issue Dec 21, 2017 · 2 comments
Closed

inspect.isdatadescriptor false negative #76581

chnlior mannequin opened this issue Dec 21, 2017 · 2 comments
Labels
docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@chnlior
Copy link
Mannequin

chnlior mannequin commented Dec 21, 2017

BPO 32400
Nosy @serhiy-storchaka, @aaronchall, @corona10, @chnlior
Superseder
  • bpo-26103: Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)
  • 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 2018-06-10.11:24:32.055>
    created_at = <Date 2017-12-21.18:57:04.972>
    labels = ['type-bug', 'library', 'docs']
    title = 'inspect.isdatadescriptor  false negative'
    updated_at = <Date 2018-06-10.11:24:32.054>
    user = 'https://github.com/chnlior'

    bugs.python.org fields:

    activity = <Date 2018-06-10.11:24:32.054>
    actor = 'berker.peksag'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2018-06-10.11:24:32.055>
    closer = 'berker.peksag'
    components = ['Documentation', 'Library (Lib)']
    creation = <Date 2017-12-21.18:57:04.972>
    creator = 'chnlior'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32400
    keywords = ['patch']
    message_count = 2.0
    messages = ['308895', '319204']
    nosy_count = 5.0
    nosy_names = ['docs@python', 'serhiy.storchaka', 'Aaron Hall', 'corona10', 'chnlior']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '26103'
    type = 'behavior'
    url = 'https://bugs.python.org/issue32400'
    versions = ['Python 3.6']

    @chnlior
    Copy link
    Mannequin Author

    chnlior mannequin commented Dec 21, 2017

    According to the c code in Include/descrobject.h

    #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)

    and according to the "data model" chapter,
    a data descriptor is an object who has __set__ and /or __delete__.

    the "inspect.isdatadescriptor" checks for existence of __get__ and __set__ which IMHO is wrong. an object with __set__/delete only will return falsely False (should be True).

    This is related to @serhiy Storchaka comment in bpo-26103 opened by @aaron Hall.

    @chnlior chnlior mannequin assigned docspython Dec 21, 2017
    @chnlior chnlior mannequin added docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Dec 21, 2017
    @chnlior chnlior mannequin changed the title inspect.isdatadescriptor fasle negative inspect.isdatadescriptor false negative Dec 21, 2017
    @corona10
    Copy link
    Member

    @serhiy Storchaka
    This issue can be closed due to PR 1959

    @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
    docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants