Title: Use the C domain roles consistently in the documentation · Issue #107091 · python/cpython · GitHub
Open Graph Title: Use the C domain roles consistently in the documentation · Issue #107091 · python/cpython
X Title: Use the C domain roles consistently in the documentation · Issue #107091 · python/cpython
Description: :c:member:, :c:data: and :c:var: are equivalent. I do not know whether there is a semantic difference between :c:data: and :c:var: (although I think that :c:member: is semantically different and should be used for attributes). :c:member:...
Open Graph Description: :c:member:, :c:data: and :c:var: are equivalent. I do not know whether there is a semantic difference between :c:data: and :c:var: (although I think that :c:member: is semantically different and sh...
X Description: :c:member:, :c:data: and :c:var: are equivalent. I do not know whether there is a semantic difference between :c:data: and :c:var: (although I think that :c:member: is semantically different and sh...
Opengraph URL: https://github.com/python/cpython/issues/107091
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use the C domain roles consistently in the documentation","articleBody":"`:c:member:`, `:c:data:` and `:c:var:` are equivalent. I do not know whether there is a semantic difference between `:c:data:` and `:c:var:` (although I think that `:c:member:` is semantically different and should be used for attributes).\r\n\r\n`:c:member:` is used 813 times for 202 names.\r\n\r\n`:c:data:` is used 265 times for 143 names:\r\n\u003cdetails\u003e\r\n\r\n```\r\n:c:data:`command`\r\n:c:data:`errno`\r\n:c:data:`immutable types \u003cPy_TPFLAGS_IMMUTABLETYPE\u003e`\r\n:c:data:`nb_long`\r\n:c:data:`nb_reserved`\r\n:c:data:`PyBool_Type`\r\n:c:data:`Py_buffer`\r\n:c:data:`Py_buffer.format`\r\n:c:data:`Py_buffer.itemsize`\r\n:c:data:`Py_BytesWarningFlag`\r\n:c:data:`PyCallIter_Type`\r\n:c:data:`PyCFunction`\r\n:c:data:`PyCMethod`\r\n:c:data:`PyContextToken_Type`\r\n:c:data:`PyContext_Type`\r\n:c:data:`PyContextVar_Type`\r\n:c:data:`PyDateTimeAPI`\r\n:c:data:`PyDateTime_Date`\r\n:c:data:`PyDateTime_DateTime`\r\n:c:data:`PyDateTime_DateTimeType`\r\n:c:data:`PyDateTime_DateType`\r\n:c:data:`PyDateTime_Delta`\r\n:c:data:`PyDateTime_DeltaType`\r\n:c:data:`PyDateTime_Time`\r\n:c:data:`PyDateTime_TimeType`\r\n:c:data:`PyDateTime_TimeZone_UTC`\r\n:c:data:`PyDateTime_TZInfoType`\r\n:c:data:`Py_Ellipsis`\r\n:c:data:`Py_eval_input`\r\n:c:data:`PyExc_ArithmeticError`\r\n:c:data:`PyExc_AssertionError`\r\n:c:data:`PyExc_AttributeError`\r\n:c:data:`PyExc_BaseException`\r\n:c:data:`PyExc_BlockingIOError`\r\n:c:data:`PyExc_BrokenPipeError`\r\n:c:data:`PyExc_BufferError`\r\n:c:data:`PyExc_BytesWarning`\r\n:c:data:`PyExc_ChildProcessError`\r\n:c:data:`PyExc_ConnectionAbortedError`\r\n:c:data:`PyExc_ConnectionError`\r\n:c:data:`PyExc_ConnectionRefusedError`\r\n:c:data:`PyExc_ConnectionResetError`\r\n:c:data:`PyExc_DeprecationWarning`\r\n:c:data:`PyExc_EnvironmentError`\r\n:c:data:`PyExc_EOFError`\r\n:c:data:`PyExc_Exception`\r\n:c:data:`PyExc_FileExistsError`\r\n:c:data:`PyExc_FileNotFoundError`\r\n:c:data:`PyExc_FloatingPointError`\r\n:c:data:`PyExc_FutureWarning`\r\n:c:data:`PyExc_GeneratorExit`\r\n:c:data:`PyExc_ImportError`\r\n:c:data:`PyExc_ImportWarning`\r\n:c:data:`PyExc_IndentationError`\r\n:c:data:`PyExc_IndexError`\r\n:c:data:`PyExc_InterruptedError`\r\n:c:data:`PyExc_IOError`\r\n:c:data:`PyExc_IsADirectoryError`\r\n:c:data:`PyExc_KeyboardInterrupt`\r\n:c:data:`PyExc_KeyError`\r\n:c:data:`PyExc_LookupError`\r\n:c:data:`PyExc_MemoryError`\r\n:c:data:`PyExc_ModuleNotFoundError`\r\n:c:data:`PyExc_NameError`\r\n:c:data:`PyExc_NotADirectoryError`\r\n:c:data:`PyExc_NotImplementedError`\r\n:c:data:`PyExc_OSError`\r\n:c:data:`PyExc_OverflowError`\r\n:c:data:`PyExc_PendingDeprecationWarning`\r\n:c:data:`PyExc_PermissionError`\r\n:c:data:`PyExc_ProcessLookupError`\r\n:c:data:`PyExc_RecursionError`\r\n:c:data:`PyExc_ReferenceError`\r\n:c:data:`PyExc_ResourceWarning`\r\n:c:data:`PyExc_RuntimeError`\r\n:c:data:`PyExc_RuntimeWarning`\r\n:c:data:`PyExc_StopAsyncIteration`\r\n:c:data:`PyExc_StopIteration`\r\n:c:data:`PyExc_SyntaxError`\r\n:c:data:`PyExc_SyntaxWarning`\r\n:c:data:`PyExc_SystemError`\r\n:c:data:`PyExc_SystemExit`\r\n:c:data:`PyExc_TabError`\r\n:c:data:`PyExc_TimeoutError`\r\n:c:data:`PyExc_TypeError`\r\n:c:data:`PyExc_UnboundLocalError`\r\n:c:data:`PyExc_UnicodeDecodeError`\r\n:c:data:`PyExc_UnicodeEncodeError`\r\n:c:data:`PyExc_UnicodeError`\r\n:c:data:`PyExc_UnicodeTranslateError`\r\n:c:data:`PyExc_UnicodeWarning`\r\n:c:data:`PyExc_UserWarning`\r\n:c:data:`PyExc_ValueError`\r\n:c:data:`PyExc_Warning`\r\n:c:data:`PyExc_WindowsError`\r\n:c:data:`PyExc_ZeroDivisionError`\r\n:c:data:`Py_False`\r\n:c:data:`Py_file_input`\r\n:c:data:`Py_FileSystemDefaultEncodeErrors`\r\n:c:data:`PyFunction_Type`\r\n:c:data:`Py_IgnoreEnvironmentFlag`\r\n:c:data:`PyImport_FrozenModules`\r\n:c:data:`PyImport_Inittab`\r\n:c:data:`PyInstanceMethod_Type`\r\n:c:data:`PyMethod_Type`\r\n:c:data:`Py_mod_exec`\r\n:c:data:`PyModuleDef_HEAD_INIT`\r\n:c:data:`PyModule_Type`\r\n:c:data:`Py_None`\r\n:c:data:`Py_NotImplemented`\r\n:c:data:`PyOS_ReadlineFunctionPointer`\r\n:c:data:`Py_Py3kWarningFlag`\r\n:c:data:`PySeqIter_Type`\r\n:c:data:`Py_single_input`\r\n:c:data:`PyStructSequence_UnnamedField`\r\n:c:data:`Py_tp_base`\r\n:c:data:`Py_tp_bases`\r\n:c:data:`PyTrace_CALL`\r\n:c:data:`PyTrace_C_CALL`\r\n:c:data:`PyTrace_C_EXCEPTION`\r\n:c:data:`PyTrace_C_RETURN`\r\n:c:data:`PyTrace_EXCEPTION`\r\n:c:data:`PyTrace_LINE`\r\n:c:data:`PyTrace_OPCODE`\r\n:c:data:`PyTrace_RETURN`\r\n:c:data:`Py_True`\r\n:c:data:`PyType_GetModuleByDef`\r\n:c:data:`PyType_Type`\r\n:c:data:`PyUnicode_1BYTE_KIND`\r\n:c:data:`PyUnicode_2BYTE_KIND`\r\n:c:data:`PyUnicode_4BYTE_KIND`\r\n:c:data:`PyUnicode_WCHAR_KIND`\r\n:c:data:`Py_UTF8Mode`\r\n:c:data:`Py_Version`\r\n:c:data:`rl_attempted_completion_function`\r\n:c:data:`rl_completer_word_break_characters`\r\n:c:data:`rl_completion_display_matches_hook`\r\n:c:data:`rl_completion_type`\r\n:c:data:`rl_line_buffer`\r\n:c:data:`rl_pre_input_hook`\r\n:c:data:`rl_startup_hook`\r\n:c:data:`SpamError`\r\n:c:data:`sts`\r\n```\r\n\u003c/details\u003e\r\nIn some of these cases (e.g. for `nb_long` or `Py_buffer.format`) `:c:member:` looks more semantically appropriate.\r\n\r\n`:c:var:` is used 51 times for 28 names:\r\n\u003cdetails\u003e\r\n\r\n```\r\n:c:var:`Py_BytesWarningFlag`\r\n:c:var:`Py_DebugFlag`\r\n:c:var:`Py_DontWriteBytecodeFlag`\r\n:c:var:`Py_FileSystemDefaultEncodeErrors`\r\n:c:var:`Py_FileSystemDefaultEncoding`\r\n:c:var:`Py_FrozenFlag`\r\n:c:var:`Py_HasFileSystemDefaultEncoding`\r\n:c:var:`Py_HashRandomizationFlag`\r\n:c:var:`Py_IgnoreEnvironmentFlag`\r\n:c:var:`Py_InspectFlag`\r\n:c:var:`Py_InteractiveFlag`\r\n:c:var:`Py_IsolatedFlag`\r\n:c:var:`Py_LegacyWindowsFSEncodingFlag`\r\n:c:var:`Py_LegacyWindowsStdioFlag`\r\n:c:var:`Py_NoSiteFlag`\r\n:c:var:`Py_NoUserSiteDirectory`\r\n:c:var:`Py_OptimizeFlag`\r\n:c:var:`PyOS_InputHook`\r\n:c:var:`PyOS_ReadlineFunctionPointer`\r\n:c:var:`Py_QuietFlag`\r\n:c:var:`PyStructSequence_UnnamedField`\r\n:c:var:`PyType_Type`\r\n:c:var:`Py_UnbufferedStdioFlag`\r\n:c:var:`Py_UTF8Mode`\r\n:c:var:`Py_VerboseFlag`\r\n:c:var:`Py_Version`\r\n```\r\n\u003c/details\u003e\r\n\r\nIn some cases `:data:` (purposed for use with Python names) is used with a C name. It is definitely error.\r\n\r\nIn what cases should we use `:c:data:` and in what cases should we use `:c:var:`? I do not see a system in the current use.\r\n\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-107092\r\n* gh-107113\r\n* gh-107121\r\n* gh-107129\r\n* gh-107138\r\n* gh-107063\n* gh-107310\n* gh-107311\n* gh-107312\n* gh-107313\n* gh-107318\n* gh-107330\n* gh-107331\n* gh-107378\n* gh-107379\n* gh-107384\n* gh-107385\n* gh-107416\n* gh-107417\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2023-07-23T06:21:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/107091/cpython/issues/107091"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:64673f6d-ab01-cf87-2e7c-8480b18a7e77 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99AE:3B507F:1E0D305:294E8D3:696ABCF4 |
| html-safe-nonce | 804e6c362e127a92216461f8bb6f419aaae966972580db2a50f81bc128530ec4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUFFOjNCNTA3RjoxRTBEMzA1OjI5NEU4RDM6Njk2QUJDRjQiLCJ2aXNpdG9yX2lkIjoiNDQzOTQ4NTA5NjA3ODc4NTc4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 24ac4247b1e5a38b46bbd844d1994348099eafff6bcd62758bd32e91cdeff528 |
| hovercard-subject-tag | issue:1817005773 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/107091/issue_layout |
| twitter:image | https://opengraph.githubassets.com/89d7cec922e494151ed0f2f051202d845d8ac6c03ff4b24a7bab6012b70d8d7b/python/cpython/issues/107091 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/89d7cec922e494151ed0f2f051202d845d8ac6c03ff4b24a7bab6012b70d8d7b/python/cpython/issues/107091 |
| og:image:alt | :c:member:, :c:data: and :c:var: are equivalent. I do not know whether there is a semantic difference between :c:data: and :c:var: (although I think that :c:member: is semantically different and sh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 46ce962e0e18113ea447391b6ace8b02d4d2861e57b4fbab3658698f73d8855b |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 30300f30bb3949de255e84a146706a3bdb5c19c9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width