Skip to content

inspect.isdatadescriptor false negative #76581

Description

@chnlior
mannequin
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']

    Activity

    1. chnlior commented on Dec 21, 2017

      chnliormannequin
      MannequinAuthor

      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.

    2. added
      docsDocumentation in the Doc dir
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Dec 21, 2017
    3. changed the title [-]inspect.isdatadescriptor fasle negative[/-] [+]inspect.isdatadescriptor false negative[/+] on Dec 21, 2017
    4. corona10 commented on Jun 10, 2018

      @corona10
      Member

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

    5. 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

      docsDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions