Skip to content

Conversation

@erlend-aasland
Copy link
Owner

@erlend-aasland erlend-aasland commented Sep 8, 2023


📚 Documentation preview 📚: https://cpython-devguide--1.org.readthedocs.build/

larryhastings and others added 30 commits January 4, 2014 12:44
'python' clinic block, not a 'clinic' clinic block.  Patch written by
Ryan Smith-Roberts.
and return converter from existing functions.
* You may now specify an expression as the default value for a
  parameter!  Example: "sys.maxsize - 1".  This support is
  intentionally quite limited; you may only use values that
  can be represented as static C values.
* Removed "doc_default", simplified support for "c_default"
  and "py_default".  (I'm not sure we still even need
  "py_default", but I'm leaving it in for now in case a
  use presents itself.)
* Parameter lines support a trailing '\\' as a line
  continuation character, allowing you to break up long lines.
* The argument parsing code generated when supporting optional
  groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize,
  leading to a 850% speedup in parsing.  (Just kidding, this
  is an unmeasurable difference.)
* A bugfix for the recent regression where the generated
  prototype from pydoc for builtins would be littered with
  unreadable "=<object ...>"" default values for parameters
  that had no default value.
* Converted some asserts into proper failure messages.
* Many doc improvements and fixes.
delaying its output or even redirecting it to a separate file.
including correctly generating code for Clinic blocks inside C
preprocessor conditional blocks.
"format units".  Updated the documentation to match.
The underlying zlib library stores sizes in “unsigned int”. The corresponding
Python parameters are all sizes of buffers filled in by zlib, so it is okay
to reduce higher values to the UINT_MAX internal cap. OverflowError is still
raised for sizes that do not fit in Py_ssize_t.

Sizes are now limited to Py_ssize_t rather than unsigned long, because Python
byte strings cannot be larger than Py_ssize_t. Previously this could result
in a SystemError on 32-bit platforms.

This resolves a regression in the gzip module when reading more than UINT_MAX
or LONG_MAX bytes in one call, introduced by revision 62723172412c.
noamcohen97 and others added 24 commits September 8, 2023 13:37
…oc (#95529)

The converter was removed in 74b5e4ce80858ac5c7d03411cb8cce7e6865f181
…erters (python/cpython#104390)

Use the unused keyword param in the converter to explicitly
mark an argument as unused:

    /*[clinic input]
    SomeBaseClass.stubmethod
        flag: bool(unused=True)
    [clinic start generated code]*/
…hon#106872)

Previous ToC layout (excerpt):

    - How to use symbolic default values
    ...
    - How to assign default values to parameter
      - How to use the ``NULL`` default value
      - How to use expressions as default values

New layout:

    - How to assign default values to parameter
      - The ``NULL`` default value
      - Symbolic default values
      - Expressions as default values
…python/cpython#106904)

Add Background as a toplevel section with the following subsections:

- Background
  - The goals of Argument Clinic
  - Basic concepts and usage

Rename "Converting your first function" to Tutorial.

Add anchors for Background, Tutorial, and How-to Guides:

- :ref:`clinic-background`
- :ref:`clinic-tutorial`
- :ref:`clinic-howtos`

Link to these from within the Abstract.

Break the compatibility paragraph out of Abstract and make it a note.

Co-authored-by: Ezio Melotti <[email protected]>
…thon/cpython#107203)

Instead, order the tutorial as one body of prose, making it easier to
align the tutorial according to Diátaxis principles.
…/cpython#106981)

Split "Basic concepts and usage" into:

- Reference
  - Terminology
  - CLI reference

- Background
  - Basic concepts

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
…hon/cpython#107508)

Summarise the goals of Argument Clinic in a single sentence.
Mention that Argument Clinic was introduced with PEP-436.
…hon/cpython#107328)

- Omit unneccesary wording and sentences
- Don't mention implementation details (no digression, explanation)

Co-authored-by: Ezio Melotti <[email protected]>
…of parameters (python/cpython#95151)

It is now possible to deprecate passing parameters positionally with
Argument Clinic, using the new '* [from X.Y]' syntax.
(To be read as "keyword-only from Python version X.Y")

Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
- fix formatting in @text_signature howto and NEWS entry
- fix formatting and example text in deprecate-positionals howto
- use cpy-file iso. source

- fix Sphinx complaint about 'range'

- mark up abstract similar to other devguide pages
@erlend-aasland erlend-aasland changed the base branch from main to master September 8, 2023 11:45
@erlend-aasland erlend-aasland changed the base branch from master to main September 8, 2023 11:46
@erlend-aasland
Copy link
Owner Author

GitHub links rewritten to point to python/cpython#xxx.

@erlend-aasland erlend-aasland deleted the migrate-argument-clinic-docs-rewritten branch October 11, 2023 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.