CINXE.COM
PEP 697 – Limited C API for Extending Opaque Types - #30 by gpshead - PEPs - Discussions on Python.org
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>PEP 697 – Limited C API for Extending Opaque Types - #30 by gpshead - PEPs - Discussions on Python.org</title> <meta name="description" content="Hello, I’ve posted PEP 697, dealing with a pretty specific pain point when extending classes using the C API: namely, tight coupling to the superclass. I’ve floated the idea on python-dev in May and got positive feedba&hellip;"> <meta name="generator" content="Discourse 3.5.0.beta3-dev - https://github.com/discourse/discourse version 8b212d95ed4f38eb1576e585d4a8ddec617dc12d"> <link rel="icon" type="image/png" href="https://us1.discourse-cdn.com/flex002/uploads/python1/optimized/1X/9997f0605d56c4bfecd63594f52f42cdafd6b06a_2_32x32.png"> <link rel="apple-touch-icon" type="image/png" href="https://us1.discourse-cdn.com/flex002/uploads/python1/optimized/1X/4c06143de7870c35963b818b15b395092a434991_2_180x180.png"> <meta name="theme-color" media="(prefers-color-scheme: light)" content="#fff"> <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#111111"> <meta name="color-scheme" content="light dark"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, viewport-fit=cover"> <link rel="canonical" href="https://discuss.python.org/t/pep-697-limited-c-api-for-extending-opaque-types/19743?page=2" /> <link rel="search" type="application/opensearchdescription+xml" href="https://discuss.python.org/opensearch.xml" title="Discussions on Python.org Search"> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/color_definitions_base__2_5010ce7169eb5b1b10c3bb26cfa9a1d7e9f8168b.css?__ws=discuss.python.org" media="(prefers-color-scheme: light)" rel="stylesheet" class="light-scheme"/><link href="https://sea2.discourse-cdn.com/flex002/stylesheets/color_definitions_dark_1_2_ecec79c82ffc2f92115d21264f67e31b13b20f76.css?__ws=discuss.python.org" media="(prefers-color-scheme: dark)" rel="stylesheet" class="dark-scheme" data-scheme-id="1"/> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/desktop_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="desktop" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/automation_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="automation" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/checklist_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="checklist" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-ai_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-ai" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-akismet_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-akismet" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-chat-integration_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-chat-integration" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-data-explorer_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-data-explorer" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-details_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-details" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-lazy-videos_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-lazy-videos" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-local-dates_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-local-dates" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-math_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-math" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-narrative-bot_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-narrative-bot" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-policy_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-policy" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-presence_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-presence" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-solved_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-solved" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-templates_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-templates" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-topic-voting_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-topic-voting" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-user-notes_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-user-notes" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/footnote_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="footnote" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/hosted-site_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="hosted-site" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/poll_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="poll" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/spoiler-alert_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="spoiler-alert" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-ai_desktop_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-ai_desktop" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/discourse-topic-voting_desktop_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="discourse-topic-voting_desktop" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/poll_desktop_dc3a905dd4a1532bdfdf54d26ab303effeceb06d.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="poll_desktop" /> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/desktop_theme_4_693eb3094c15cb629231acb7486e07737cbfcdd3.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="4" data-theme-name="unformatted code detector"/> <link href="https://sea2.discourse-cdn.com/flex002/stylesheets/desktop_theme_2_510b85e1b0e841b8f2f8c7ec51df89b1170f9307.css?__ws=discuss.python.org" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="2" data-theme-name="light"/> <link rel="alternate nofollow" type="application/rss+xml" title="RSS feed of 'PEP 697 – Limited C API for Extending Opaque Types'" href="https://discuss.python.org/t/pep-697-limited-c-api-for-extending-opaque-types/19743.rss" /> <meta property="og:site_name" content="Discussions on Python.org" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:image" content="https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/f93ff97c4f381b5e8add5a0c163b4ded29f20ed7.png" /> <meta property="og:image" content="https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/f93ff97c4f381b5e8add5a0c163b4ded29f20ed7.png" /> <meta property="og:url" content="https://discuss.python.org/t/pep-697-limited-c-api-for-extending-opaque-types/19743/30" /> <meta name="twitter:url" content="https://discuss.python.org/t/pep-697-limited-c-api-for-extending-opaque-types/19743/30" /> <meta property="og:title" content="PEP 697 – Limited C API for Extending Opaque Types" /> <meta name="twitter:title" content="PEP 697 – Limited C API for Extending Opaque Types" /> <meta property="og:description" content="To clarify, does this mean the PEP is accepted now that I merged your PR? Yep! Accepted!" /> <meta name="twitter:description" content="To clarify, does this mean the PEP is accepted now that I merged your PR? Yep! Accepted!" /> <meta property="og:article:section" content="PEPs" /> <meta property="og:article:section:color" content="0088CC" /> <meta property="article:published_time" content="2023-03-07T17:01:17+00:00" /> <meta property="og:ignore_canonical" content="true" /> </head> <body class="crawler browser-update"> <header> <a href="/"> Discussions on Python.org </a> </header> <div id="main-outlet" class="wrap" role="main"> <div id="topic-title"> <h1> <a href="/t/pep-697-limited-c-api-for-extending-opaque-types/19743">PEP 697 – Limited C API for Extending Opaque Types</a> </h1> <div class="topic-category" itemscope itemtype="http://schema.org/BreadcrumbList"> <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a href="/c/peps/19" class="badge-wrapper bullet" itemprop="item"> <span class='badge-category-bg' style='background-color: #0088CC'></span> <span class='badge-category clear-badge'> <span class='category-name' itemprop='name'>PEPs</span> </span> </a> <meta itemprop="position" content="1" /> </span> </div> </div> <div itemscope itemtype='http://schema.org/DiscussionForumPosting'> <meta itemprop='headline' content='PEP 697 – Limited C API for Extending Opaque Types'> <link itemprop='url' href='https://discuss.python.org/t/pep-697-limited-c-api-for-extending-opaque-types/19743'> <meta itemprop='datePublished' content='2022-10-06T14:18:06Z'> <meta itemprop='articleSection' content='PEPs'> <meta itemprop='keywords' content=''> <div itemprop='publisher' itemscope itemtype="http://schema.org/Organization"> <meta itemprop='name' content='Python Software Foundation'> <div itemprop='logo' itemscope itemtype="http://schema.org/ImageObject"> <meta itemprop='url' content='https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/c7591c98caf3b31d4d9c6f322f41ed9d80a50800.png'> </div> </div> <span itemprop='author' itemscope itemtype="http://schema.org/Person"> <meta itemprop='name' content='encukou'> <link itemprop='url' rel='nofollow' href='https://discuss.python.org/u/encukou'> </span> <meta itemprop='text' content='Hello, I’ve posted PEP 697, dealing with a pretty specific pain point when extending classes using the C API: namely, tight coupling to the superclass. I’ve floated the idea on python-dev in May and got positive feedba&hellip;'> <div id='post_30' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" rel='nofollow' href='https://discuss.python.org/u/gpshead'><span itemprop='name'>gpshead</span></a> (Gregory P. Smith) </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2023-03-07T17:01:17Z' class='post-time'> March 7, 2023, 5:01pm </time> <meta itemprop='dateModified' content='2023-03-07T17:01:17Z'> <span itemprop='position'>30</span> </span> </div> <div class='post' itemprop='text'> <blockquote> <p>To clarify, does this mean the PEP is accepted now that I merged your PR?</p> </blockquote> <p>Yep! Accepted!</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="1" /> <span class='post-likes'>1 Like</span> </div> </div> </div> <div role='navigation' itemscope itemtype='http://schema.org/SiteNavigationElement' class="topic-body crawler-post"> <span itemprop='name'> <a itemprop="url" href="/t/pep-697-limited-c-api-for-extending-opaque-types/19743?page=2#post_30">show post in topic</a> </span> </div> </div> <footer class="container wrap"> <nav class='crawler-nav'> <ul> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/' itemprop="url">Home </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/categories' itemprop="url">Categories </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/guidelines' itemprop="url">Guidelines </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/tos' itemprop="url">Terms of Service </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/privacy' itemprop="url">Privacy Policy </a> </span> </li> </ul> </nav> <p class='powered-by-link'>Powered by <a href="https://www.discourse.org">Discourse</a>, best viewed with JavaScript enabled</p> </footer> <div class="buorg"><div>Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.</div></div> </body> </html>