> ## Documentation Index
> Fetch the complete documentation index at: https://takeprofit.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Builtins

> Language reference for Indie built-in functions and types. Comprehensive documentation of supported operations, type system, and standard methods.

export const Anchor = ({id}) => {
  return <div id={id} style={{
    scrollMarginTop: "var(--scroll-mt)"
  }}></div>;
};

export const Field = ({id, name, type, required, defaultVal, children}) => {
  return <div id={id} style={{
    scrollMarginTop: "var(--scroll-mt)"
  }} className="mt-4">
      <div className="pt-2.5 pb-5 my-2.5 border-gray-50 dark:border-gray-800/50 border-b">
        <div className="flex font-mono text-sm group/param-head param-head">
          <div className="flex-1 flex content-start py-0.5 mr-5">
            <div className="flex items-center flex-wrap gap-2">
              {id && <div className="absolute">
                  <a href={`#${id}`} className="-ml-10 flex items-center opacity-0 border-0 group-hover/param-head:opacity-100 py-2" aria-label={`Navigate to ${id}`}>
                    <div className="w-6 h-6 text-gray-400 rounded-md flex items-center justify-center zinc-box bg-white ring-1 ring-gray-400/30 dark:ring-gray-700/25 hover:ring-gray-400/60 dark:hover:ring-white/20">
                      <svg xmlns="http://www.w3.org/2000/svg" fill="gray" height="12px" viewBox="0 0 576 512">
                        <path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z"></path>
                      </svg>
                    </div>
                  </a>
                </div>}
              <div className="font-semibold text-primary dark:text-primary-light">
                {name}
              </div>
              <div className="flex items-center space-x-2 text-xs font-medium">
                <div className="flex items-center px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200 font-medium">
                  {type}
                </div>
                {required && <span className="px-2 py-0.5 rounded-md bg-red-100/50 dark:bg-red-400/10 text-red-600 dark:text-red-300 font-medium">
                    required
                  </span>}
                {defaultVal && <div className="flex items-center px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200 font-medium">
                    <span class="text-gray-400 dark:text-gray-500">default:</span>
                    {defaultVal}
                  </div>}
              </div>
            </div>
          </div>
        </div>
        <div className="mt-4 prose-sm prose-gray dark:prose-invert">
          {children}
        </div>
      </div>
    </div>;
};

Built-in symbols of Indie language.

***

## Variables

<Steps>
  <Step title="Constants" icon="pi">
    <Field id="const_False" name="False" type="bool">
      Built-in Indie object (similar to Python's).
    </Field>

    <Field id="const_None" name="None" type="NoneType">
      Built-in Indie object (similar to Python's).
    </Field>

    <Field id="const_True" name="True" type="bool">
      Built-in Indie object (similar to Python's).
    </Field>
  </Step>
</Steps>

***

## Functions

<Anchor id="func_abs" />

### `abs()`

*function*

<Steps>
  <Step title="Overloads" icon="pencil">
    <Field name="abs" type="(x) -> int">
      Returns the absolute value of a number. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          Number on which the function will be calculated.
        </Field>
      </Expandable>
    </Field>

    <Field name="abs" type="(x) -> float">
      Returns the absolute value of a number. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          Number on which the function will be calculated.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="func_enumerate" />

### `enumerate()`

*function*

<Steps>
  <Step title="Overloads" icon="pencil">
    <Field name="enumerate" type="(iterable, start) -> enumerate_t[T]">
      Returns an enumerate object. Can be used with any iterable object (like lists or ranges).

      <Expandable title="parameters info">
        <Field name="iterable" type="iterable[T]" required>
          An iterable to enumerate.
        </Field>

        <Field name="start" type="int" defaultVal="0">
          The start index.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="func_len" />

### `len()`

*function*

<Steps>
  <Step title="Overloads" icon="pencil">
    <Field name="len" type="(x) -> int">
      Returns the length (the number of items) of an object. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="typing.Any" required>
          Value on which the function will be calculated.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="func_max" />

### `max()`

*function*

<Steps>
  <Step title="Overloads" icon="pencil">
    <Field name="max" type="(x, y) -> int">
      Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          First number to calculate the function.
        </Field>

        <Field name="y" type="int" required>
          Second number to calculate the function.
        </Field>
      </Expandable>
    </Field>

    <Field name="max" type="(x, y, z) -> int">
      Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          First number to calculate the function.
        </Field>

        <Field name="y" type="int" required>
          Second number to calculate the function.
        </Field>

        <Field name="z" type="int" required>
          Third number to calculate the function.
        </Field>
      </Expandable>
    </Field>

    <Field name="max" type="(x, y) -> float">
      Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          First number to calculate the function.
        </Field>

        <Field name="y" type="float" required>
          Second number to calculate the function.
        </Field>
      </Expandable>
    </Field>

    <Field name="max" type="(x, y, z) -> float">
      Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          First number to calculate the function.
        </Field>

        <Field name="y" type="float" required>
          Second number to calculate the function.
        </Field>

        <Field name="z" type="float" required>
          Third number to calculate the function.
        </Field>
      </Expandable>
    </Field>

    <Field name="max" type="(l) -> int">
      Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="l" type="list[int]" required>
          List on which the function will be calculated.
        </Field>
      </Expandable>
    </Field>

    <Field name="max" type="(l) -> float">
      Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="l" type="list[float]" required>
          List on which the function will be calculated.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="func_min" />

### `min()`

*function*

<Steps>
  <Step title="Overloads" icon="pencil">
    <Field name="min" type="(x, y) -> int">
      Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          First number to calculate the function.
        </Field>

        <Field name="y" type="int" required>
          Second number to calculate the function.
        </Field>
      </Expandable>
    </Field>

    <Field name="min" type="(x, y, z) -> int">
      Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          First number to calculate the function.
        </Field>

        <Field name="y" type="int" required>
          Second number to calculate the function.
        </Field>

        <Field name="z" type="int" required>
          Third number to calculate the function.
        </Field>
      </Expandable>
    </Field>

    <Field name="min" type="(x, y) -> float">
      Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          First number to calculate the function.
        </Field>

        <Field name="y" type="float" required>
          Second number to calculate the function.
        </Field>
      </Expandable>
    </Field>

    <Field name="min" type="(x, y, z) -> float">
      Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          First number to calculate the function.
        </Field>

        <Field name="y" type="float" required>
          Second number to calculate the function.
        </Field>

        <Field name="z" type="float" required>
          Third number to calculate the function.
        </Field>
      </Expandable>
    </Field>

    <Field name="min" type="(l) -> int">
      Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="l" type="list[int]" required>
          List on which the function will be calculated.
        </Field>
      </Expandable>
    </Field>

    <Field name="min" type="(l) -> float">
      Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="l" type="list[float]" required>
          List on which the function will be calculated.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="func_round" />

### `round()`

*function*

<Steps>
  <Step title="Overloads" icon="pencil">
    <Field name="round" type="(number) -> int">
      Returns number rounded to ndigits precision after the decimal point. If ndigits is omitted or is None, it returns the nearest integer to its input. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="number" type="float" required>
          Number on which the function will be calculated.
        </Field>
      </Expandable>
    </Field>

    <Field name="round" type="(number, ndigits) -> float">
      Returns number rounded to ndigits precision after the decimal point. If ndigits is omitted or is None, it returns the nearest integer to its input. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="number" type="float" required>
          Number on which the function will be calculated.
        </Field>

        <Field name="ndigits" type="indie.Optional[int]" defaultVal="None">
          Rounding precision.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="func_sum" />

### `sum()`

*function*

<Steps>
  <Step title="Overloads" icon="pencil">
    <Field name="sum" type="(l, start) -> int">
      Sums start and the items of a list from left to right and returns the total. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="l" type="list[int]" required>
          List on which the function will be calculated.
        </Field>

        <Field name="start" type="int" defaultVal="0">
          Initial value to calculate sum of the list.
        </Field>
      </Expandable>
    </Field>

    <Field name="sum" type="(l, start) -> float">
      Sums start and the items of a list from left to right and returns the total. It is a built-in Indie function (similar to Python's).

      <Expandable title="parameters info">
        <Field name="l" type="list[float]" required>
          List on which the function will be calculated.
        </Field>

        <Field name="start" type="float" defaultVal="0.0">
          Initial value to calculate sum of the list.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

## Types

<Anchor id="class_bool" />

### `bool`

*type*

Built-in Indie type (similar to Python's).

<Steps>
  <Step title="Methods" icon="function">
    <Field id="method_bool_init" name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `bool` value, i.e. one of `True` or `False`. The argument is converted using the standard [Python's truth testing procedure](https://docs.python.org/3/library/stdtypes.html#truth).

      <Expandable title="parameters info">
        <Field name="x" type="bool" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `bool` value, i.e. one of `True` or `False`. The argument is converted using the standard [Python's truth testing procedure](https://docs.python.org/3/library/stdtypes.html#truth).

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `bool` value, i.e. one of `True` or `False`. The argument is converted using the standard [Python's truth testing procedure](https://docs.python.org/3/library/stdtypes.html#truth).

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `bool` value, i.e. one of `True` or `False`. The argument is converted using the standard [Python's truth testing procedure](https://docs.python.org/3/library/stdtypes.html#truth).

      <Expandable title="parameters info">
        <Field name="x" type="str" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `bool` value, i.e. one of `True` or `False`. The argument is converted using the standard [Python's truth testing procedure](https://docs.python.org/3/library/stdtypes.html#truth).

      <Expandable title="parameters info">
        <Field name="x" type="NoneType" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="class_dict" />

### `dict[K, V]`

*type*

Built-in Indie type (similar to Python's).

***

<Anchor id="class_float" />

### `float`

*type*

Built-in Indie type (similar to Python's).

<Steps>
  <Step title="Methods" icon="function">
    <Field id="method_float_init" name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `float` number constructed from a number or a string.

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `float` number constructed from a number or a string.

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `float` number constructed from a number or a string.

      <Expandable title="parameters info">
        <Field name="x" type="str" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `float` number constructed from a number or a string.

      <Expandable title="parameters info">
        <Field name="x" type="bool" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="class_int" />

### `int`

*type*

Built-in Indie type (similar to Python's).

<Steps>
  <Step title="Methods" icon="function">
    <Field id="method_int_init" name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns an `int` object constructed from a number or a string, or return 0 if no arguments are given.

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns an `int` object constructed from a number or a string, or return 0 if no arguments are given.

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns an `int` object constructed from a number or a string, or return 0 if no arguments are given.

      <Expandable title="parameters info">
        <Field name="x" type="str" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns an `int` object constructed from a number or a string, or return 0 if no arguments are given.

      <Expandable title="parameters info">
        <Field name="x" type="bool" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

***

<Anchor id="class_list" />

### `list[T]`

*type*

Built-in Indie type (similar to Python's).

<Steps>
  <Step title="Methods" icon="function">
    <Field id="method_list_append" name="append" type="(x) -> None">
      Appends given param to the end of the list.

      <Expandable title="parameters info">
        <Field name="x" type="T" required>
          New value that will be put to the list.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_list_getitem" name="__getitem__" type="(i) -> T">
      Returns list element at given index.

      <Expandable title="parameters info">
        <Field name="i" type="int" required>
          Index of an element in the list.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      meaning_of_life = nums[2]  # returns 42 (this implicitly calls `nums.__getitem__(2)`)
      ```

      <Note>Method `__getitem__` should never be called directly, instead `list_obj[key]` syntax should be used.</Note>
    </Field>

    <Field id="method_list_setitem" name="__setitem__" type="(i, x) -> None">
      Assigns value to some\_list\[key].

      <Expandable title="parameters info">
        <Field name="i" type="int" required>
          Index of an element in the list.
        </Field>

        <Field name="x" type="T" required>
          New value that will be put to the list.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      nums[2] = 100500  # this implicitly calls `nums.__setitem__(2, 100500)`
                        # and now `nums` are [40, 41, 100500, 43]
      ```

      <Note>Method `__setitem__` should never be called directly, instead `list_obj[key] = value` syntax should be used.</Note>
    </Field>

    <Field id="method_list_delitem" name="__delitem__" type="(i) -> None">
      Delete an item from the list at the given index.

      <Expandable title="parameters info">
        <Field name="i" type="int" required>
          Index of an element in the list.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      del nums[2]  # this implicitly calls `nums.__delitem__(2)`
      ```

      <Note>Method `__delitem__` should never be called directly, instead `del list_obj[key]` syntax should be used.</Note>
    </Field>

    <Field id="method_list_delslice" name="__delslice__" type="(start, stop, step) -> None">
      Delete a slice from the list.

      <Expandable title="parameters info">
        <Field name="start" type="indie.Optional[int]" defaultVal="None">
          Starting index for slice. Can be omitted. See more examples below.
        </Field>

        <Field name="stop" type="indie.Optional[int]" defaultVal="None">
          Ending index for slice (not included). Can be omitted. See more examples below.
        </Field>

        <Field name="step" type="int" defaultVal="1">
          Step between indexes of slice. Can be omitted. See more examples below.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      del nums[0:2]  # this implicitly calls `nums.__delslice__(0, 2, 1)`
      ```

      <Note>Method `__delslice__` should never be called directly, instead `del list_obj[slice]` syntax should be used.</Note>
    </Field>

    <Field id="method_list_len" name="__len__" type="() -> int">
      Returns the length (the number of items) of a list\[T].

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      len(nums)  # returns 4 (this implicitly calls `nums.__len__()`)
      ```

      <Note>Method `__len__` should never be called directly, instead `len(list_obj)` syntax should be used.</Note>
    </Field>

    <Field id="method_list_bool" name="__bool__" type="() -> bool">
      Returns `True` if the list is not empty.
    </Field>

    <Field id="method_list_contains" name="__contains__" type="(x) -> bool">
      Returns `True` if the list contains the given value, otherwise `False`.

      <Expandable title="parameters info">
        <Field name="x" type="T" required>
          Element to find in the list.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      my_bool = 41 in nums  # this implicitly calls `nums.__contains__(41)`
      ```

      <Note>Method `__contains__` should never be called directly, instead `val in lst` syntax should be used.</Note>
    </Field>

    <Field id="method_list_remove" name="remove" type="(x) -> None">
      Removes the first item from list `s` where `s[i]` is equal to given param.

      <Expandable title="parameters info">
        <Field name="x" type="T" required>
          Value that will be removed from the list
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 40, 41, 42]
      nums.remove(42)  # now `nums` are [40, 41, 40, 41, 42]
      ```
    </Field>

    <Field id="method_list_pop" name="pop" type="(i) -> T">
      Retrieves the item at given index and also removes it from the list.

      <Expandable title="parameters info">
        <Field name="i" type="int" defaultVal="-1">
          Index of an element in the list.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      meaning_of_life = nums.pop(2)  # now `nums` are [40, 41, 43], `meaning_of_life` is 42
      ```
    </Field>

    <Field id="method_list_insert" name="insert" type="(i, x) -> None">
      Insert a value at the specified index.

      <Expandable title="parameters info">
        <Field name="i" type="int" required>
          Index of an element in the list.
        </Field>

        <Field name="x" type="T" required>
          New value that will be put to the list.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      nums.insert(2, 50)  # now `nums` are [40, 41, 50, 42, 43]
      ```
    </Field>

    <Field id="method_list_clear" name="clear" type="() -> None">
      Remove all items from the list.

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      nums.clear()  # now `nums` is []
      ```
    </Field>

    <Field id="method_list_reverse" name="reverse" type="() -> None">
      Reverses the elements of the list in place.
    </Field>

    <Field id="method_list_index" name="index" type="(x) -> int">
      Returns index of the first occurrence of the item in the list. If not found returns `-1`.

      <Expandable title="parameters info">
        <Field name="x" type="T" required>
          Element to find in the list.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_list_getslice" name="__getslice__" type="(start, stop, step) -> list[T]">
      Returns a slice of the list elements.

      <Expandable title="parameters info">
        <Field name="start" type="indie.Optional[int]" defaultVal="None">
          Starting index for slice. Can be omitted. See more examples below.
        </Field>

        <Field name="stop" type="indie.Optional[int]" defaultVal="None">
          Ending index for slice (not included). Can be omitted. See more examples below.
        </Field>

        <Field name="step" type="int" defaultVal="1">
          Step between indexes of slice. Can be omitted. See more examples below.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      meaning_of_life = nums[1:3]  # returns [41, 42] (this implicitly calls `nums.__getslice__(1, 3, 1)`)
      ```

      <Note>Method `__getslice__` should never be called directly, instead `list_obj[slice]` syntax should be used.</Note>
    </Field>

    <Field id="method_list_setslice" name="__setslice__" type="(start, stop, step, new_list) -> None">
      Assigns given list to some\_list\[slice].

      <Expandable title="parameters info">
        <Field name="start" type="indie.Optional[int]" defaultVal="None">
          Starting index for slice. Can be omitted. See more examples below.
        </Field>

        <Field name="stop" type="indie.Optional[int]" defaultVal="None">
          Ending index for slice (not included). Can be omitted. See more examples below.
        </Field>

        <Field name="step" type="int" defaultVal="1">
          Step between indexes of slice. Can be omitted. See more examples below.
        </Field>

        <Field name="new_list" type="list[T]" required>
          List to get values from.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums = [40, 41, 42, 43]
      nums[1:3] = [50, 51, 52]  # this implicitly calls `nums.__setslice__(1, 3, 1, [50, 51, 52])`
                                # and now `nums` are [40, 50, 51, 52, 43]
      ```

      <Note>Method `__setslice__` should never be called directly, instead `list_obj[slice] = other_list` syntax should be used.</Note>
    </Field>

    <Field id="method_list_copy" name="copy" type="() -> list[T]">
      Returns a copy of the list.
    </Field>

    <Field id="method_list_extend" name="extend" type="(l) -> None">
      Extends the list by appending elements from the given list.

      <Expandable title="parameters info">
        <Field name="l" type="list[T]" required>
          List to concatenate with the current.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_list_add" name="__add__" type="(l) -> list[T]">
      Returns a concatenation of two lists.

      <Expandable title="parameters info">
        <Field name="l" type="list[T]" required>
          List to concatenate with the current.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums1 = [40, 41]
      nums2 = [42, 43]
      nums3 = nums1 + nums2  # this implicitly calls `nums1.__add__(nums2)`
      ```

      <Note>Method `__add__` should never be called directly, instead `list1 + list2` syntax should be used.</Note>
    </Field>

    <Field id="method_list_mul" name="__mul__" type="(n) -> list[T]">
      Returns a concatenation of the list with `n` its copies.

      <Expandable title="parameters info">
        <Field name="n" type="int" required>
          How many copies of the list to concatenate.
        </Field>
      </Expandable>

      ```py Example theme={null}
      nums1 = [40, 41]
      nums2 = nums1 * 3  # this implicitly calls `nums1.__mul__(3)`
                         # and now `nums2` is [40, 41, 40, 41, 40, 41]
      ```

      <Note>Method `__mul__` should never be called directly, instead `lst * n` syntax should be used.</Note>
    </Field>
  </Step>
</Steps>

```py Example theme={null}
# examples of list creation:
a = [1, 2, 3]  # `a` has type `list[int]`
b = [1, 2, 3, 4.2]  # `b` has type `list[float]`
c = ["a", "b", "c"]  # `c` has type `list[str]`
d = [(1, "a"), (2, "b"), (3, "c")]  # `d` has type `list[tuple[int, str]]`

e = [0, 1, 2, 3, 4, 5, 6, 7]
f = e[2:5]  # `f` is `[2, 3, 4]`
g = e[:5]  # `g` is `[0, 1, 2, 3, 4]`
h = e[2:]  # `h` is `[2, 3, 4, 5, 6, 7]`
i = e[:]  # `i` is a copy of `e`
j = e[1:7:2]  # `j` is `[1, 3, 5]`
k = e[5:2:-1]  # `k` is `[5, 4, 3]`
l = e[5::-1]  # `l` is `[5, 4, 3, 2, 1, 0]`
m = e[::-1]  # `m` is `[7, 6, 5, 4, 3, 2, 1, 0]`
```

***

<Anchor id="class_NoneType" />

### `NoneType`

*type*

Builtin Indie type (similar to Python's `NoneType` type).

***

<Anchor id="class_range" />

### `range`

*type*

Represents a range of numbers that is used in `for` loops. It is a built-in Indie class (similar to Python's).

<Steps>
  <Step title="Methods" icon="function">
    <Field id="method_range_init" name="__init__" type="(stop) -> None">
      Class constructor (initializer for the data type).

      <Expandable title="parameters info">
        <Field name="stop" type="int" required>
          Last value of the range (exclusive).
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(start, stop, step) -> None">
      Class constructor (initializer for the data type).

      <Expandable title="parameters info">
        <Field name="start" type="int" required>
          First value of the range.
        </Field>

        <Field name="stop" type="int" required>
          Last value of the range (exclusive).
        </Field>

        <Field name="step" type="int" defaultVal="1">
          Step value of the range.
        </Field>
      </Expandable>
    </Field>
  </Step>
</Steps>

```py Example theme={null}
x = 0
for i in range(10):
    x += i
```

***

<Anchor id="class_str" />

### `str`

*type*

Built-in Indie type (similar to Python's).

<Steps>
  <Step title="Methods" icon="function">
    <Field id="method_str_len" name="__len__" type="() -> int">
      Returns the length (the number of characters) of a `str`.

      ```py Example theme={null}
      s = 'foobar'
      len(s)  # returns 6 (this implicitly calls `s.__len__()`)
      ```

      <Note>Method `__len__` should never be called directly, instead `len(str_obj)` syntax should be used.</Note>
    </Field>

    <Field id="method_str_init" name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `str` version of object.

      <Expandable title="parameters info">
        <Field name="x" type="int" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `str` version of object.

      <Expandable title="parameters info">
        <Field name="x" type="float" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `str` version of object.

      <Expandable title="parameters info">
        <Field name="x" type="str" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field name="__init__" type="(x) -> None">
      Cast constructor for built-in Indie type. Returns a `str` version of object.

      <Expandable title="parameters info">
        <Field name="x" type="bool" required>
          Value to cast from.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_contains" name="__contains__" type="(s) -> bool">
      Returns `True` if the string contains the given substring, otherwise `False`.

      <Expandable title="parameters info">
        <Field name="s" type="str" required>
          Substring to find in the string.
        </Field>
      </Expandable>

      ```py Example theme={null}
      my_bool = 'cd' in 'abcdef'  # this implicitly calls `'abcdef'.__contains__('cd')`
      ```

      <Note>Method `__contains__` should never be called directly, instead `str1 in str2` syntax should be used.</Note>
    </Field>

    <Field id="method_str_add" name="__add__" type="(s) -> str">
      Returns a concatenation of two strings.

      <Expandable title="parameters info">
        <Field name="s" type="str" required>
          String to concatenate with the current.
        </Field>
      </Expandable>

      ```py Example theme={null}
      str1 = 'ab'
      str2 = 'cf'
      str3 = str1 + str2  # this implicitly calls `str1.__add__(str2)`
      ```

      <Note>Method `__add__` should never be called directly, instead `str1 + str2` syntax should be used.</Note>
    </Field>

    <Field id="method_str_mul" name="__mul__" type="(n) -> str">
      Returns a concatenation of the string with `n` its copies.

      <Expandable title="parameters info">
        <Field name="n" type="int" required>
          How many copies of the string to concatenate.
        </Field>
      </Expandable>

      ```py Example theme={null}
      my_str = 'abc'
      my_str2 = 'abc' * 3  # this implicitly calls `'abc'.__mul__(3)`
                           # and now `my_str2` is 'abcabcabc'
      ```

      <Note>Method `__mul__` should never be called directly, instead `my_str * n` syntax should be used.</Note>
    </Field>

    <Field id="method_str_getitem" name="__getitem__" type="(i) -> str">
      Returns substring at given index.

      <Expandable title="parameters info">
        <Field name="i" type="int" required>
          Index of an element in the string.
        </Field>
      </Expandable>

      ```py Example theme={null}
      my_str = 'abc'
      substr = my_str[1]  # returns "b" (this implicitly calls `my_str.__getitem__(1)`)
      ```

      <Note>Method `__getitem__` should never be called directly, instead `my_str[key]` syntax should be used.</Note>
    </Field>

    <Field id="method_str_getslice" name="__getslice__" type="(start, stop, step) -> str">
      Returns a slice of the string elements.

      <Expandable title="parameters info">
        <Field name="start" type="indie.Optional[int]" defaultVal="None">
          Starting index for slice. Can be omitted. See more examples below.
        </Field>

        <Field name="stop" type="indie.Optional[int]" defaultVal="None">
          Ending index for slice (not included). Can be omitted. See more examples below.
        </Field>

        <Field name="step" type="int" defaultVal="1">
          Step between indexes of slice. Can be omitted. See more examples below.
        </Field>
      </Expandable>

      ```py Example theme={null}
      my_str = '0123'
      meaning_of_life = my_str[1:3]  # returns '12' (this implicitly calls `my_str.__getslice__(1, 3, 1)`)
      ```

      <Note>Method `__getslice__` should never be called directly, instead `str_obj[slice]` syntax should be used.</Note>
    </Field>

    <Field id="method_str_capitalize" name="capitalize" type="() -> str">
      Returns the string with the first letter capitalized.
    </Field>

    <Field id="method_str_center" name="center" type="(length, character) -> str">
      Centers the string within the specified width using a fill character.

      <Expandable title="parameters info">
        <Field name="length" type="int" required>
          Length of the result string.
        </Field>

        <Field name="character" type="str" defaultVal="&#x22; &#x22;">
          Fill character.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_count" name="count" type="(value, start, end) -> int">
      Returns the count of non-overlapping occurrences of a substring within \[start, end].

      <Expandable title="parameters info">
        <Field name="value" type="str" required>
          Value to search for.
        </Field>

        <Field name="start" type="int" required>
          Start index to search.
        </Field>

        <Field name="end" type="int" required>
          End index to search.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_endswith" name="endswith" type="(value, start, end) -> bool">
      Returns `True` if the string ends with the suffix, otherwise `False`.

      <Expandable title="parameters info">
        <Field name="value" type="str" required>
          Value to check if the end of the string equals.
        </Field>

        <Field name="start" type="int" required>
          Start index to check the end of the string.
        </Field>

        <Field name="end" type="int" required>
          End index to check the end of the string.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_find" name="find" type="(value, start, end) -> int">
      Returns the lowest index where the substring is found.

      <Expandable title="parameters info">
        <Field name="value" type="str" required>
          Value to search for.
        </Field>

        <Field name="start" type="int" required>
          Start index for searching.
        </Field>

        <Field name="end" type="int" required>
          End index for searching.
        </Field>
      </Expandable>

      <Note>Use the `find()` method to get the position of a substring. To check for its presence, use the `in` operator.</Note>
    </Field>

    <Field id="method_str_index" name="index" type="(value, start, end) -> int">
      Returns the lowest index of the substring within \[start, end], raising an error if not found.

      <Expandable title="parameters info">
        <Field name="value" type="str" required>
          Value to search for.
        </Field>

        <Field name="start" type="int" required>
          Start index for searching.
        </Field>

        <Field name="end" type="int" required>
          End index for searching.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_isalpha" name="isalpha" type="() -> bool">
      Returns `True` if the string contains only alphabetic characters and is not empty; otherwise, `False`.
    </Field>

    <Field id="method_str_islower" name="islower" type="() -> bool">
      Returns `True` if all cased characters are lowercase and there is at least one, otherwise `False`.
    </Field>

    <Field id="method_str_isspace" name="isspace" type="() -> bool">
      Returns `True` if the string contains only whitespace and is not empty, otherwise `False`.
    </Field>

    <Field id="method_str_isupper" name="isupper" type="() -> bool">
      Returns `True` if all cased characters are uppercase and there is at least one, otherwise `False`.
    </Field>

    <Field id="method_str_join" name="join" type="(l) -> str">
      Returns a string that joins the elements of the list, using the string as a separator.

      <Expandable title="parameters info">
        <Field name="l" type="list[str]" required>
          List of strings to join.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_ljust" name="ljust" type="(length, character) -> str">
      Left justifies the string within the specified width, padding with the fill character. Returns the original string if width is less than or equal to its length.

      <Expandable title="parameters info">
        <Field name="length" type="int" required>
          Length of the result string.
        </Field>

        <Field name="character" type="str" defaultVal="&#x22; &#x22;">
          Fill character.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_lower" name="lower" type="() -> str">
      Returns a copy of the string with all cased characters in lowercase.
    </Field>

    <Field id="method_str_lstrip" name="lstrip" type="(symbols) -> str">
      Returns a copy of the string with leading characters removed.

      <Expandable title="parameters info">
        <Field name="symbols" type="str" defaultVal="&#x22; &#x22;">
          Characters to remove.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_partition" name="partition" type="(s) -> list[str]">
      Splits the string at the first occurrence of sep and returns a list with the parts before, the separator, and after.

      <Expandable title="parameters info">
        <Field name="s" type="str" required>
          String separator value.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_replace" name="replace" type="(oldvalue, newvalue, count) -> str">
      Returns a copy of the string with all occurrences of old replaced by new, or the first count occurrences if specified.

      <Expandable title="parameters info">
        <Field name="oldvalue" type="str" required>
          Old value to search.
        </Field>

        <Field name="newvalue" type="str" required>
          New value to replace with.
        </Field>

        <Field name="count" type="int" defaultVal="-1">
          How many occurrences to replace.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_rfind" name="rfind" type="(value, start, end) -> int">
      Returns the highest index of sub within \[start, end], or -1 if not found.

      <Expandable title="parameters info">
        <Field name="value" type="str" required>
          Value to search for.
        </Field>

        <Field name="start" type="int" required>
          Start index for searching.
        </Field>

        <Field name="end" type="int" required>
          End index for searching.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_rindex" name="rindex" type="(value, start, end) -> int">
      Returns the highest index of sub within \[start, end], raising an error if not found.

      <Expandable title="parameters info">
        <Field name="value" type="str" required>
          Value to search for.
        </Field>

        <Field name="start" type="int" required>
          Start index for searching.
        </Field>

        <Field name="end" type="int" required>
          End index for searching.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_rjust" name="rjust" type="(length, character) -> str">
      Right justifies the string within the specified width, padding with the fill character. Returns the original string if width is less than or equal to its length.

      <Expandable title="parameters info">
        <Field name="length" type="int" required>
          Length of the result string.
        </Field>

        <Field name="character" type="str" defaultVal="&#x22; &#x22;">
          Fill character.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_rpartition" name="rpartition" type="(s) -> list[str]">
      Splits the string at the last occurrence of sep and returns a list with the parts before, the separator, and after.

      <Expandable title="parameters info">
        <Field name="s" type="str" required>
          String separator value.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_rsplit" name="rsplit" type="(separator, maxsplit) -> list[str]">
      Splits the string into words using sep as the delimiter, with an optional maxsplit from the right.

      <Expandable title="parameters info">
        <Field name="separator" type="str" defaultVal="&#x22; &#x22;">
          String separator value.
        </Field>

        <Field name="maxsplit" type="int" defaultVal="-1">
          Number of splits.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_rstrip" name="rstrip" type="(symbols) -> str">
      Returns a copy of the string with trailing characters removed.

      <Expandable title="parameters info">
        <Field name="symbols" type="str" defaultVal="&#x22; &#x22;">
          Characters to remove.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_split" name="split" type="(separator, maxsplit) -> list[str]">
      Splits the string into words using sep as the delimiter, with at most maxsplit splits, resulting in up to maxsplit+1 elements.

      <Expandable title="parameters info">
        <Field name="separator" type="str" defaultVal="&#x22; &#x22;">
          String separator value.
        </Field>

        <Field name="maxsplit" type="int" defaultVal="-1">
          Number of splits.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_startswith" name="startswith" type="(value, start, end) -> bool">
      Returns `True` if string starts with the prefix, otherwise `False`.

      <Expandable title="parameters info">
        <Field name="value" type="str" required>
          Value to check if the beginning of the string equals.
        </Field>

        <Field name="start" type="int" required>
          Start index to check the beginning of the string.
        </Field>

        <Field name="end" type="int" required>
          End index to check the beginning of the string.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_strip" name="strip" type="(symbols) -> str">
      Returns a string with the leading and trailing characters removed.

      <Expandable title="parameters info">
        <Field name="symbols" type="str" defaultVal="&#x22; &#x22;">
          Characters to remove.
        </Field>
      </Expandable>
    </Field>

    <Field id="method_str_swapcase" name="swapcase" type="() -> str">
      Returns a copy of the string with case swapped.
    </Field>

    <Field id="method_str_upper" name="upper" type="() -> str">
      Returns a copy of the string with all cased characters in uppercase.
    </Field>
  </Step>
</Steps>

```py Example theme={null}
# examples of slices extraction:
a = '01234567'
b = a[2:5]  # `b` is '234'
c = a[:5]  # `c` is '01234'
d = a[2:]  # `d` is '234567'
e = a[:]  # `e` is a copy of `a`
f = a[1:7:2]  # `f` is '135'
g = a[5:2:-1]  # `g` is '543'
h = a[5::-1]  # `h` is '543210'
i = a[::-1]  # `i` is '76543210'
```

***

<Anchor id="class_tuple" />

### `tuple[...]`

*type*

Built-in Indie type (similar to Python's).

***
