Skip to content

[C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type #83754

Closed
@vstinner

Description

@vstinner
BPO 39573
Nosy @vstinner
PRs
  • bpo-39573: Use Py_REFCNT() macro #18388
  • bpo-39573: Add Py_SET_REFCNT() function #18389
  • bpo-39573: Use Py_TYPE() in abstract.c #18390
  • bpo-39573: Use Py_TYPE() macro in Python and Include directories #18391
  • bpo-39573: Use Py_TYPE() macro in Objects directory #18392
  • bpo-39573: Use Py_TYPE() macro in Modules directory #18393
  • bpo-39573: Add Py_SET_TYPE() function #18394
  • bpo-39573: Use Py_TYPE() macro in object.c #18398
  • bpo-39573: Add Py_SET_SIZE() function #18400
  • bpo-39573: Use Py_SET_SIZE() function #18402
  • bpo-39573: Use Py_TYPE() macro in ctypes.h #18411
  • bpo-39573: Use Py_SIZE() in s_set() of cfield.c #18419
  • bpo-39573: Add Py_IS_TYPE macro #18488
  • bpo-39573: Fix bad copy-paste in Py_SET_SIZE. #18496
  • bpo-39573: Update clinic to use Py_IS_TYPE macro #18507
  • bpo-39573: Update Include/* to use Py_IS_TYPE #18508
  • bpo-39573: Clean up modules and headers to use Py_IS_TYPE #18521
  • bpo-39573: Finish converting to new Py_IS_TYPE macro. #18601
  • bpo-39573: Use Py_IS_TYPE for type checking #18789
  • bpo-39573: Use Py_IS_TYPE for negative type checks #18798
  • bpo-39573: Make Py_IS_TYPE take const args. Add _PyObject_CAST_CONST. #18799
  • bpo-39873: PyObject_Init() uses PyObject_INIT() #18804
  • bpo-39573: Use Py_IS_TYPE to check for types #18809
  • bpo-39573: Use Py_IS_TYPE to check for types #19882
  • bpo-30459: Cast the result of PyList_SET_ITEM() to void #19975
  • bpo-39573: Convert Py_TYPE() to a static inline function #20290
  • bpo-39573: Fix buildbot failure for tupleobject.c #20391
  • bpo-39573: Convert Py_REFCNT and Py_SIZE to functions #20429
  • bpo-39573: Porting to Python 3.10: Py_SET_SIZE() macro #20610
  • [WIP, DO NOT MERGE] bpo-41188: Prepare CPython for opague PyObject structure. #21262
  • bpo-39573: Use the Py_TYPE() macro #21433
  • bpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros #23366
  • bpo-39573: Remove What's new entry for Py_SIZE() #23375
  • bpo-39573: Py_TYPE becomes a static inline function #26493
  • bpo-11105: use a lower recursion limit for infinite recursion tests #26550
  • bpo-44348: Revert "bpo-39573: Py_TYPE becomes a static inline function (GH-26493)" #26596
  • bpo-39573: Py_TYPE becomes a static inline function #28128
  • 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 2021-09-08.16:32:15.871>
    created_at = <Date 2020-02-06.23:07:12.131>
    labels = ['expert-C-API', '3.11']
    title = '[C API] Avoid accessing PyObject and PyVarObject members directly: add Py_SET_TYPE() and Py_IS_TYPE(), disallow Py_TYPE(obj)=type'
    updated_at = <Date 2022-01-20.00:24:00.180>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2022-01-20.00:24:00.180>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-09-08.16:32:15.871>
    closer = 'vstinner'
    components = ['C API']
    creation = <Date 2020-02-06.23:07:12.131>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39573
    keywords = ['patch']
    message_count = 96.0
    messages = ['361513', '361514', '361515', '361516', '361517', '361518', '361519', '361522', '361523', '361526', '361527', '361529', '361531', '361540', '361549', '361555', '361557', '361590', '361593', '361607', '361611', '361626', '361631', '361639', '361904', '361960', '361961', '361963', '361964', '361965', '361971', '361977', '361987', '361988', '362033', '362034', '362133', '362134', '362166', '362212', '362216', '362445', '363345', '363494', '363564', '365690', '366473', '366493', '368047', '369896', '369898', '370074', '370303', '370638', '370663', '370665', '370666', '370671', '370729', '370902', '370932', '372308', '373460', '379675', '379679', '379680', '379757', '379759', '381337', '381345', '381365', '381374', '381403', '381404', '382260', '382534', '382539', '382780', '382781', '382783', '394954', '394971', '395018', '395205', '395206', '395287', '395323', '395536', '401365', '401370', '401378', '401395', '401396', '401399', '403252', '410995']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['18388', '18389', '18390', '18391', '18392', '18393', '18394', '18398', '18400', '18402', '18411', '18419', '18488', '18496', '18507', '18508', '18521', '18601', '18789', '18798', '18799', '18804', '18809', '19882', '19975', '20290', '20391', '20429', '20610', '21262', '21433', '23366', '23375', '26493', '26550', '26596', '28128']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39573'
    versions = ['Python 3.11']

    Linked PRs

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions