Commit Graph

68 Commits

Author SHA1 Message Date
Christian Heimes f66c857572
bpo-45459: Add Py_buffer to limited API (GH-29991)
- [x] ``Py_buffer`` struct
- [x] ``PyBuffer_*()`` API functions
- [x] ``PyBUF_*`` constants
- [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots
- [x] ``PyMemoryView_FromBuffer()`` API
- [x] tests for limited API
- [x] ``make regen-limited-abi``
- [x] documentation update
- [ ] export ``PyPickleBuffer*()`` API ???
2022-02-02 07:03:10 -08:00
David Hewitt 31ff96712e
bpo-46140: take more Py_buffer arguments as const * (GH-30217) 2021-12-22 15:07:46 +02:00
Victor Stinner 474652fe93
bpo-40204, doc: Fix syntax of C variables (GH-21846)
For example, fix the following Sphinx 3 errors:

Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters
Invalid C declaration: Expected identifier in nested name. [error at 5]
  void \*obj
  -----^

Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*'
Invalid C declaration: Expected end of definition. [error at 8]
  PyObject*
  --------^

The modified documentation is compatible with Sphinx 2 and Sphinx 3.
2020-08-13 22:11:50 +02:00
Victor Stinner 46d10b1237
bpo-40204: Fix duplicates in the documentation (GH-21857)
Fix two Sphinx 3 issues:

Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'.
Declaration is 'PyBUF_ND'.

Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'.
Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'.
2020-08-13 19:16:02 +02:00
Serhiy Storchaka e835b31d2b
bpo-38600: NULL -> ``NULL``. (GH-17001)
Also fix some other formatting.
2019-10-30 21:37:16 +02:00
Serhiy Storchaka 25fc088607
bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)
Replace all *NULL* with ``NULL``.
2019-10-30 12:03:20 +02:00
Hai Shi 15f5a7527b bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992)
https://bugs.python.org/issue37698
2019-09-11 10:25:55 -07:00
Hai Shi 5a56ce4a0e bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988)
https://bugs.python.org/issue37750



Automerge-Triggered-By: @matrixise
2019-09-11 09:38:47 -07:00
Greg Price 9ece4a5057 Unmark files as executable that can't actually be executed. (GH-15353)
There are plenty of legitimate scripts in the tree that begin with a
`#!`, but also a few that seem to be marked executable by mistake.

Found them with this command -- it gets executable files known to Git,
filters to the ones that don't start with a `#!`, and then unmarks
them as executable:

    $ git ls-files --stage \
      | perl -lane 'print $F[3] if (!/^100644/)' \
      | while read f; do
          head -c2 "$f" | grep -qxF '#!' \
          || chmod a-x "$f"; \
        done

Looking at the list by hand confirms that we didn't sweep up any
files that should have the executable bit after all.  In particular

 * The `.psd` files are images from Photoshop.

 * The `.bat` files sure look like things that can be run.
   But we have lots of other `.bat` files, and they don't have
   this bit set, so it must not be needed for them.



Automerge-Triggered-By: @benjaminp
2019-08-20 21:53:59 -07:00
Joannah Nanjekye 9e66aba999 bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)
Implement PyBuffer_SizeFromFormat() function (previously
documented but not implemented): call struct.calcsize().
2019-08-20 15:46:36 +01:00
Hai Shi 1b29af83bc bpo-34101: Add doc of PyBuffer_GetPointer (GH-14994) 2019-07-31 16:48:15 +02:00
Joseph Fox-Rabinovitz bd26a4466b Docs: Correct formatting of a multiline code block (GH-13806) 2019-07-17 11:13:01 +03:00
Stéphane Wirtel cbb6484573 Doc: Replace the deprecated highlightlang directive by highlight. (#13377)
highlightlang is deprecated since April 2018 in Sphinx.
See https://github.com/sphinx-doc/sphinx/pull/4845
2019-05-17 15:25:34 +05:30
Serhiy Storchaka 3fcc1e08db
bpo-35461: Document C API functions which suppress exceptions. (GH-11119) 2018-12-18 13:57:17 +02:00
Andre Delfino 55f41e45b4 Correct a couple of unbalanced parenthesis. (GH-10779) 2018-12-05 21:45:30 +02:00
Antoine Pitrou aa50bf08e6
bpo-33126: Document PyBuffer_ToContiguous() (#6292) 2018-03-28 17:26:32 +02:00
vyas45 1b9e76ed3a bpo-31754: Fix type of 'itemsize' in PyBuffer_FillContiguousStrides (GH-3993) 2017-10-15 10:31:36 +03:00
Serhiy Storchaka 1ecf7d204d Issue #28496: Mark up constants 0, 1 and -1 that denote return values or
special input values as literal text.
2016-10-27 21:41:19 +03:00
Martin Panter 2eb819f7a8 Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5 2015-11-02 04:04:57 +00:00
Martin Panter 7462b64911 Issue #25523: Correct "a" article to "an" article
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
or edited some other way to fix the grammar.
2015-11-02 03:37:02 +00:00
Benjamin Peterson 8e205f7b4f merge 3.4 (#24883) 2015-08-17 23:38:46 -07:00
Benjamin Peterson 2053aa1193 'Py_Buffer' should be 'Py_buffer' (closes #24883) 2015-08-17 23:38:34 -07:00
Stefan Krah 70e543b266 Issue #23756: Clarify the terms "contiguous" and "bytes-like object".
Patch by Martin Panter.
2015-08-08 14:33:28 +02:00
Stefan Krah 3e9bec26f4 Whitespace. 2015-02-01 19:45:14 +01:00
Stefan Krah 0dc4e153a2 Issue #23352: Document that Py_buffer.suboffsets must be NULL if no suboffsets
are required.
2015-02-01 19:42:12 +01:00
Stefan Krah bb458dbe59 Issue #21778: Clarify use of flags if PyBuffer_FillInfo() is used inside a
getbufferproc().
2014-06-30 00:15:45 +02:00
Jesus Cea e8ef8b7a20 Closes #21441: Reorder elements in documentation to match actual order in the code 2014-06-25 05:37:17 +02:00
Stefan Krah 3a43d06321 Whitespace. 2015-02-01 19:46:31 +01:00
Georg Brandl 44ea77bd81 Closes #4159: add LaTeX tabular column specifications to tables that otherwise are cut off or have overlapping text. 2013-03-28 13:28:44 +01:00
Chris Jerdonek 5fae0e5854 Improve str() and object.__str__() documentation (issue #13538). 2012-11-20 17:45:51 -08:00
Stefan Krah abd887d690 Issue #14181: Improve clarity in the documentation for the multi-purpose
Py_buffer.obj field.
2012-03-06 14:55:06 +01:00
Stefan Krah 9a2d99e28a - Issue #10181: New memoryview implementation fixes multiple ownership
and lifetime issues of dynamically allocated Py_buffer members (#9990)
  as well as crashes (#8305, #7433). Many new features have been added
  (See whatsnew/3.3), and the documentation has been updated extensively.
  The ndarray test object from _testbuffer.c implements all aspects of
  PEP-3118, so further development towards the complete implementation
  of the PEP can proceed in a test-driven manner.

  Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review
  and many ideas.

- Issue #12834: Fix incorrect results of memoryview.tobytes() for
  non-contiguous arrays.

- Issue #5231: Introduce memoryview.cast() method that allows changing
  format and shape without making a copy of the underlying memory.
2012-02-25 12:24:21 +01:00
Ezio Melotti da5b852c7c #12072: merge with 3.1. 2011-05-20 15:06:32 +03:00
Ezio Melotti 261d855fd6 #12072: add missing parenthesis in the doc. Patch by Sandro Tosi. 2011-05-20 15:04:38 +03:00
Antoine Pitrou 34db469895 Remove documentation to non-existent function PyObject_CopyToObject (fixes #11478) 2011-03-13 19:32:01 +01:00
Antoine Pitrou 6b19e50e9b Remove documentation to non-existent function PyObject_CopyToObject (fixes #11478) 2011-03-13 19:31:11 +01:00
Antoine Pitrou a92d1f5041 Merged revisions 87188-87190,87192-87194 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87188 | antoine.pitrou | 2010-12-12 19:25:25 +0100 (dim., 12 déc. 2010) | 3 lines

  Make this a warning and fix indentation
........
  r87189 | antoine.pitrou | 2010-12-12 20:59:47 +0100 (dim., 12 déc. 2010) | 3 lines

  Better explain the buffer interface (hopefully)
........
  r87190 | antoine.pitrou | 2010-12-12 21:01:43 +0100 (dim., 12 déc. 2010) | 3 lines

  Add link to the buffer protocol description from the memory description.
........
  r87192 | antoine.pitrou | 2010-12-12 21:09:18 +0100 (dim., 12 déc. 2010) | 3 lines

  Remove redundant sentence, and fix markup
........
  r87193 | antoine.pitrou | 2010-12-12 21:13:31 +0100 (dim., 12 déc. 2010) | 3 lines

  Fix heading level
........
  r87194 | antoine.pitrou | 2010-12-12 21:17:29 +0100 (dim., 12 déc. 2010) | 3 lines

  Consistent ordering of availability statements
........
2010-12-12 21:07:49 +00:00
Antoine Pitrou 8abc93580d Better explain the buffer interface (hopefully) 2010-12-12 19:59:47 +00:00
Georg Brandl 60203b41b0 Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
Georg Brandl 8ffe0bc55f Merged revisions 76923,76926,77009,77082-77083,77085,77087,77121 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k

................
  r76923 | georg.brandl | 2009-12-20 15:24:06 +0100 (So, 20 Dez 2009) | 1 line

  #7493: more review fixes.
................
  r76926 | georg.brandl | 2009-12-20 15:38:23 +0100 (So, 20 Dez 2009) | 9 lines

  Recorded merge of revisions 76925 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r76925 | georg.brandl | 2009-12-20 15:33:20 +0100 (So, 20 Dez 2009) | 1 line

    #7381: subprocess documentation and library docstring consistency fixes.
  ........
................
  r77009 | georg.brandl | 2009-12-23 11:30:45 +0100 (Mi, 23 Dez 2009) | 1 line

  #7417: add signature to open() docstring.
................
  r77082 | georg.brandl | 2009-12-28 08:59:20 +0100 (Mo, 28 Dez 2009) | 1 line

  #7577: fix signature info for getbufferproc.
................
  r77083 | georg.brandl | 2009-12-28 09:00:47 +0100 (Mo, 28 Dez 2009) | 9 lines

  Merged revisions 77081 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r77081 | georg.brandl | 2009-12-28 08:59:05 +0100 (Mo, 28 Dez 2009) | 1 line

    #7577: fix signature of PyBuffer_FillInfo().
  ........
................
  r77085 | georg.brandl | 2009-12-28 09:02:38 +0100 (Mo, 28 Dez 2009) | 9 lines

  Merged revisions 77084 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r77084 | georg.brandl | 2009-12-28 09:01:59 +0100 (Mo, 28 Dez 2009) | 1 line

    #7586: fix typo.
  ........
................
  r77087 | georg.brandl | 2009-12-28 09:10:38 +0100 (Mo, 28 Dez 2009) | 9 lines

  Recorded merge of revisions 77086 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r77086 | georg.brandl | 2009-12-28 09:09:32 +0100 (Mo, 28 Dez 2009) | 1 line

    #7381: consistency update, and backport avoiding ``None >= 0`` check from py3k.
  ........
................
  r77121 | georg.brandl | 2009-12-29 22:38:35 +0100 (Di, 29 Dez 2009) | 1 line

  #7590: exception classes no longer are in the "exceptions" module. Also clean up text that was written with string exceptions in mind.
................
2010-10-06 07:17:29 +00:00
Georg Brandl 48a866c9ee Work around a bug in Sphinx 0.6.x. 2010-10-06 06:49:22 +00:00
Georg Brandl c9e59c1241 Merged revisions 85132 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k

........
  r85132 | georg.brandl | 2010-10-01 07:38:10 +0200 (Fr, 01 Okt 2010) | 1 line

  Fix weird markup that caused latex to fail.
........
2010-10-01 05:41:48 +00:00
Georg Brandl d0ffa4cc8c Fix weird markup that caused latex to fail. 2010-10-01 05:38:10 +00:00
Antoine Pitrou 6ec5ed22b2 Merged revisions 85084 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85084 | antoine.pitrou | 2010-09-29 01:59:51 +0200 (mer., 29 sept. 2010) | 5 lines

  Give a dedicated page to memoryview objects, so that they can be part
  of the concrete objects layer, while the buffer protocol is part of
  the abstract objects layer.
........
2010-09-29 00:01:41 +00:00
Antoine Pitrou c663b58c9a Give a dedicated page to memoryview objects, so that they can be part
of the concrete objects layer, while the buffer protocol is part of
the abstract objects layer.
2010-09-28 23:59:51 +00:00
Antoine Pitrou debf4dbf07 Merged revisions 85082 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85082 | antoine.pitrou | 2010-09-29 01:39:41 +0200 (mer., 29 sept. 2010) | 4 lines

  Buffers are not sequence objects (!). Put them in the abstract objects layers
  instead.
........
2010-09-28 23:41:31 +00:00
Antoine Pitrou f7ba2fa3d6 Buffers are not sequence objects (!). Put them in the abstract objects layers
instead.
2010-09-28 23:39:41 +00:00
Antoine Pitrou 9207f1d634 Merged revisions 85080 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85080 | antoine.pitrou | 2010-09-29 01:04:04 +0200 (mer., 29 sept. 2010) | 3 lines

  Various improvements to the docs of the buffer API
........
2010-09-28 23:05:17 +00:00
Antoine Pitrou 99a00a455c Various improvements to the docs of the buffer API 2010-09-28 23:04:04 +00:00
Antoine Pitrou 1ec68b132e Merged revisions 85066 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85066 | antoine.pitrou | 2010-09-28 17:29:16 +0200 (mar., 28 sept. 2010) | 3 lines

  Issue #9970: improve C API documentation for memoryview objects
........
2010-09-28 15:33:25 +00:00