Variable: python-indent-def-block-scale

python-indent-def-block-scale is a customizable variable defined in python.el.gz.

Value

2

Documentation

Multiplier applied to indentation inside multi-line blocks.

The indentation in parens in the block header will be the current indentation plus python-indent-offset multiplied by this variable. For example, the arguments are indented as follows if this variable is 1:

    def do_something(
        arg1,
        arg2):
        print('hello')

if this variable is 2 (default):

    def do_something(
            arg1,
            arg2):
        print('hello')

This variable has an effect on all blocks, not just def block. This variable only works if the opening paren is not followed by non-whitespace characters on the same line. Modify python-indent-block-paren-deeper to customize the case where non-whitespace characters follow the opening paren on the same line.

This variable was added, or its default value changed, in Emacs 26.1.

Probably introduced at or before Emacs version 26.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defcustom python-indent-def-block-scale 2
  "Multiplier applied to indentation inside multi-line blocks.
The indentation in parens in the block header will be the current
indentation plus `python-indent-offset' multiplied by this
variable.  For example, the arguments are indented as follows if
this variable is 1:

    def do_something(
        arg1,
        arg2):
        print('hello')

if this variable is 2 (default):

    def do_something(
            arg1,
            arg2):
        print('hello')

This variable has an effect on all blocks, not just def block.
This variable only works if the opening paren is not followed by
non-whitespace characters on the same line.  Modify
`python-indent-block-paren-deeper' to customize the case where
non-whitespace characters follow the opening paren on the same
line."
  :version "26.1"
  :type 'integer
  :safe 'natnump)