Title: gh-101100: Fix sphinx warnings in `Doc/c-api/memoryview.rst` by sobolevn · Pull Request #114669 · python/cpython · GitHub
Open Graph Title: gh-101100: Fix sphinx warnings in `Doc/c-api/memoryview.rst` by sobolevn · Pull Request #114669 · python/cpython
X Title: gh-101100: Fix sphinx warnings in `Doc/c-api/memoryview.rst` by sobolevn · Pull Request #114669 · python/cpython
Description: It used to be: /Users/sobolev/Desktop/cpython2/Doc/c-api/memoryview.rst:25: WARNING: c:macro reference target not found: PyBUF_READ /Users/sobolev/Desktop/cpython2/Doc/c-api/memoryview.rst:25: WARNING: c:macro reference target not found: PyBUF_WRITE I documented these values there, because they are primarily used in memoryview. Grep: Misc/stable_abi.toml 2336:[const.PyBUF_READ] 2338:[const.PyBUF_WRITE] Python/import.c 3506: data = PyMemoryView_FromMemory((char *)info.data, info.size, PyBUF_READ); 3547: if (PyObject_GetBuffer(dataobj, &buf, PyBUF_READ) != 0) { Include/pybuffer.h 113:#define PyBUF_WRITEABLE PyBUF_WRITABLE 137:#define PyBUF_READ 0x100 138:#define PyBUF_WRITE 0x200 Objects/memoryobject.c 740: PyBUF_READ or PyBUF_WRITE. view->format is set to "B" (unsigned bytes). 750: assert(flags == PyBUF_READ || flags == PyBUF_WRITE); 756: readonly = (flags == PyBUF_WRITE) ? 0 : 1; 952: buffertype={PyBUF_READ, PyBUF_WRITE} and order={'C', 'F'ortran, or 'A'ny}. 957: As usual, if buffertype=PyBUF_WRITE, the exporter's buffer must be writable, 963: Otherwise, if the buffertype is PyBUF_READ, the memoryview will be 974: assert(buffertype == PyBUF_READ || buffertype == PyBUF_WRITE); 982: if (buffertype == PyBUF_WRITE && view->readonly) { 992: if (buffertype == PyBUF_WRITE) { 2095: x->mview = PyMemoryView_FromMemory(x->item, itemsize, PyBUF_WRITE); Lib/test/test_buffer.py 888: contig = get_contiguous(result, PyBUF_READ, order) 1278: self.assertRaises(TypeError, get_contiguous, nd, PyBUF_READ, 961) 1279: self.assertRaises(UnicodeEncodeError, get_contiguous, nd, PyBUF_READ, 1281: self.assertRaises(ValueError, get_contiguous, nd, PyBUF_READ, 'Z') 2487: self.assertRaises(ValueError, get_contiguous, nd, PyBUF_READ, 'C') 2488: self.assertRaises(ValueError, get_contiguous, nd, PyBUF_READ, 'F') 2489: self.assertRaises(ValueError, get_contiguous, nd[::-1], PyBUF_READ, 'C') 3981: self.assertRaises(TypeError, get_contiguous, {}, PyBUF_READ, 'F') 3984: self.assertRaises(BufferError, get_contiguous, b'x', PyBUF_WRITE, 'C') 3988: self.assertRaises(BufferError, get_contiguous, nd, PyBUF_WRITE, 'A') 3993: m = get_contiguous(nd, PyBUF_READ, order) 4000: m = get_contiguous(nd, PyBUF_READ, order) 4007: m = get_contiguous(nd, PyBUF_WRITE, order) 4018: m = get_contiguous(nd, PyBUF_READ, order) 4026: m = get_contiguous(nd, PyBUF_READ, order) 4032: m = get_contiguous(nd, PyBUF_WRITE, order) 4038: m = get_contiguous(nd, PyBUF_WRITE, order) 4045: m = get_contiguous(nd, PyBUF_READ, order) 4054: m = get_contiguous(nd, PyBUF_READ, order) 4064: m = get_contiguous(nd, PyBUF_WRITE, order) 4067: self.assertRaises(BufferError, get_contiguous, nd, PyBUF_WRITE, 'F') 4068: m = get_contiguous(nd, PyBUF_READ, order) 4074: m = get_contiguous(nd, PyBUF_WRITE, order) 4077: self.assertRaises(BufferError, get_contiguous, nd, PyBUF_WRITE, 'C') 4078: m = get_contiguous(nd, PyBUF_READ, order) 4084: self.assertRaises(BufferError, get_contiguous, nd, PyBUF_WRITE, 4086: m = get_contiguous(nd, PyBUF_READ, order) 4091: m = get_contiguous(nd, PyBUF_READ, 'C') Modules/_pickle.c 1403: PyObject *buf_obj = PyMemoryView_FromMemory(buf, n, PyBUF_WRITE); Modules/_testbuffer.c 413: mview = PyMemoryView_FromMemory(ptr, itemsize, PyBUF_WRITE); 582: mview = PyMemoryView_FromMemory(ptr, itemsize, PyBUF_READ); 711: mview = PyMemoryView_FromMemory(item, base->itemsize, PyBUF_WRITE); 2399: "buffertype must be PyBUF_READ or PyBUF_WRITE"); 2407: if (type != PyBUF_READ && type != PyBUF_WRITE) { 2878: PyModule_AddIntMacro(m, PyBUF_READ); 2879: PyModule_AddIntMacro(m, PyBUF_WRITE); Issue: gh-101100 📚 Documentation preview 📚: https://cpython-previews--114669.org.readthedocs.build/
Open Graph Description: It used to be: /Users/sobolev/Desktop/cpython2/Doc/c-api/memoryview.rst:25: WARNING: c:macro reference target not found: PyBUF_READ /Users/sobolev/Desktop/cpython2/Doc/c-api/memoryview.rst:25: WARN...
X Description: It used to be: /Users/sobolev/Desktop/cpython2/Doc/c-api/memoryview.rst:25: WARNING: c:macro reference target not found: PyBUF_READ /Users/sobolev/Desktop/cpython2/Doc/c-api/memoryview.rst:25: WARN...
Opengraph URL: https://github.com/python/cpython/pull/114669
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7e305ab8-e346-af57-a531-0972a4e866ae |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 99F6:22F528:2BD65D:3E0CAA:696A1D00 |
| html-safe-nonce | 9cc275851d8d2089d7e271aed89d041de1c93f17de4f86fb67ed1ac7f57ecb70 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUY2OjIyRjUyODoyQkQ2NUQ6M0UwQ0FBOjY5NkExRDAwIiwidmlzaXRvcl9pZCI6Ijg1MzQxNTIyODg2NzI1NTQyNDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b351c4d068f49b50443816d56483c6a152b264b8b1c00eff4e7f5c381d9d24f0 |
| hovercard-subject-tag | pull_request:1698663006 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/114669/files |
| twitter:image | https://avatars.githubusercontent.com/u/4660275?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4660275?s=400&v=4 |
| og:image:alt | It used to be: /Users/sobolev/Desktop/cpython2/Doc/c-api/memoryview.rst:25: WARNING: c:macro reference target not found: PyBUF_READ /Users/sobolev/Desktop/cpython2/Doc/c-api/memoryview.rst:25: WARN... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 014f3d193f36b7d393f88ca22d06fbacd370800b40a547c1ea67291e02dc8ea3 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d515f6f09fa57a93bf90355cb894eb84ca4f458f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width