appropriately named script from that directory.
* When called with ``-c command``, it executes the Python statement(s) given as
*command*. Here *command* may contain multiple statements separated by
- newlines. Leading whitespace is significant in Python statements!
+ newlines.
* When called with ``-m module-name``, the given module is located on the
Python module path and executed as a script.
(Contributed by Noah Kim and Adam Turner in :gh:`118655`.)
* The command-line option :option:`-c` now automatically dedents its code
- argument before execution. The auto-dedentation behavior mirrors
- :func:`textwrap.dedent`.
+ argument before execution.
(Contributed by Jon Crall and Steven Sun in :gh:`103998`.)
* :option:`!-J` is no longer a reserved flag for Jython_,
/* Dedent a string.
- Behaviour is expected to be an exact match of `textwrap.dedent`.
+ Intended to dedent Python source. Unlike `textwrap.dedent`, this
+ only supports spaces and tabs and doesn't normalize empty lines.
Return a new reference on success, NULL with exception set on error.
*/
extern PyObject* _PyUnicode_Dedent(PyObject *unicode);
.. nonce: BS3uVt
.. section: Core and Builtins
-String arguments passed to "-c" are now automatically dedented as if by
-:func:`textwrap.dedent`. This allows "python -c" invocations to be indented
+String arguments passed to "-c" are now automatically dedented.
+This allows "python -c" invocations to be indented
in shell scripts without causing indentation errors. (Patch by Jon Crall and
Steven Sun)
}
/* Dedent a string.
- Behaviour is expected to be an exact match of `textwrap.dedent`.
+ Intended to dedent Python source. Unlike `textwrap.dedent`, this
+ only supports spaces and tabs and doesn't normalize empty lines.
Return a new reference on success, NULL with exception set on error.
*/
PyObject *