Skip to content

Update documented signatures of tp_get/setattr #72957

Closed

Description

@vadmium
BPO 28771
Nosy @vadmium, @serhiy-storchaka
Dependencies
  • bpo-25701: Document that tp_setattro and tp_setattr are used for deleting attributes
  • Files
  • typeobj-sigs.patch
  • typeobj-sigs.v2.py2.patch
  • 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 2016-12-10.06:55:34.981>
    created_at = <Date 2016-11-22.11:53:08.866>
    labels = ['3.7', 'docs']
    title = 'Update documented signatures of tp_get/setattr'
    updated_at = <Date 2016-12-10.06:55:34.981>
    user = 'https://github.com/vadmium'

    bugs.python.org fields:

    activity = <Date 2016-12-10.06:55:34.981>
    actor = 'martin.panter'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2016-12-10.06:55:34.981>
    closer = 'martin.panter'
    components = ['Documentation']
    creation = <Date 2016-11-22.11:53:08.866>
    creator = 'martin.panter'
    dependencies = ['25701']
    files = ['45600', '45616']
    hgrepos = []
    issue_num = 28771
    keywords = ['patch']
    message_count = 5.0
    messages = ['281468', '281599', '281600', '282124', '282831']
    nosy_count = 4.0
    nosy_names = ['docs@python', 'python-dev', 'martin.panter', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue28771'
    versions = ['Python 2.7', 'Python 3.5', 'Python 3.6', 'Python 3.7']

    Activity

    1. vadmium commented on Nov 22, 2016

      @vadmium
      MemberAuthor

      https://docs.python.org/3.7/c-api/typeobj.html#c.PyTypeObject.tp_getattr

      tp_getattr and tp_setattr take a non-const char pointer in their signatures, but the documentation points to PyObject_GetAttrString() etc which were changed to take const char pointers a long time ago: revision 2f19b981ac24.

      This patch fixes the documentation of those two methods for Python 3. There could be more fixes needed for Python 2.

    2. vadmium commented on Nov 24, 2016

      @vadmium
      MemberAuthor

      In Python 2, charbufferproc was changed to use non-const char ** in revision dba6494735d0 (perhaps by accident). Otherwise, this patch is the same as for Python 3. I have added a sentence about using NULL for deletion in the patch.

    3. vadmium commented on Nov 24, 2016

      @vadmium
      MemberAuthor

      Python 2 patch is on top of the patch for bpo-25701

    4. python-dev commented on Dec 1, 2016

      python-devmannequin
      Mannequin

      New changeset 2fd070fa6c15 by Martin Panter in branch '2.7':
      Issue bpo-28771: Correct documentation of signatures using const
      https://hg.python.org/cpython/rev/2fd070fa6c15

    5. python-dev commented on Dec 10, 2016

      python-devmannequin
      Mannequin

      New changeset 5d51ac0be72a by Martin Panter in branch '3.5':
      Issue bpo-28771: Update tp_get/setattr signature documentation
      https://hg.python.org/cpython/rev/5d51ac0be72a

      New changeset ee8c8b79d1d5 by Martin Panter in branch '3.6':
      Issue bpo-28771: Merge C API doc fix from 3.5
      https://hg.python.org/cpython/rev/ee8c8b79d1d5

      New changeset c4865975b804 by Martin Panter in branch 'default':
      Issue bpo-28771: Merge C API doc fix from 3.6
      https://hg.python.org/cpython/rev/c4865975b804

    6. 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)end of lifedocsDocumentation in the Doc dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions