Built-in symbols of Indie language.


Variables

Constants

False
bool

Built-in Indie object (similar to Python’s).

None
NoneType

Built-in Indie object (similar to Python’s).

True
bool

Built-in Indie object (similar to Python’s).


Functions

abs()

function

Overloads

abs
(x) -> int

Returns the absolute value of a number. It is a built-in Indie function (similar to Python’s).

abs
(x) -> float

Returns the absolute value of a number. It is a built-in Indie function (similar to Python’s).


len()

function

Overloads

len
(x) -> int

Returns the length (the number of items) of an object. It is a built-in Indie function (similar to Python’s).


max()

function

Overloads

max
(x, y) -> int

Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python’s).

max
(x, y, z) -> int

Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python’s).

max
(x, y) -> float

Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python’s).

max
(x, y, z) -> float

Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python’s).

max
(l) -> int

Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python’s).

max
(l) -> float

Returns the largest of two or more arguments. It is a built-in Indie function (similar to Python’s).


min()

function

Overloads

min
(x, y) -> int

Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python’s).

min
(x, y, z) -> int

Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python’s).

min
(x, y) -> float

Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python’s).

min
(x, y, z) -> float

Returns the smallest of two or more arguments. It is a built-in Indie function (similar to Python’s).


range()

function

Overloads

range
(stop) -> list[int]

Creates a list containing the specified range of numbers that is used in for loops. It is a built-in Indie function (similar to Python’s).

Example
x = 0
for i in range(10):
    x += i
The behavior of this function is similar to Python’s 2 built-in function range and is ineffective. This will be fixed in future versions of Indie.
range
(start, stop, step) -> list[int]

Creates a list containing the specified range of numbers that is used in for loops. It is a built-in Indie function (similar to Python’s).

Example
x = 0
for i in range(10):
    x += i
The behavior of this function is similar to Python’s 2 built-in function range and is ineffective. This will be fixed in future versions of Indie.

round()

function

Overloads

round
(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).

round
(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).


sum()

function

Overloads

sum
(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).

sum
(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).


Types

bool

type

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

Methods

__init__
(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.

__init__
(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.

__init__
(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.

__init__
(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.

__init__
(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.


dict[K, V]

type

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


float

type

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

Methods

__init__
(x) -> None

Cast constructor for built-in Indie type. Returns a float number constructed from a number or a string.

__init__
(x) -> None

Cast constructor for built-in Indie type. Returns a float number constructed from a number or a string.

__init__
(x) -> None

Cast constructor for built-in Indie type. Returns a float number constructed from a number or a string.

__init__
(x) -> None

Cast constructor for built-in Indie type. Returns a float number constructed from a number or a string.


int

type

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

Methods

__init__
(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.

__init__
(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.

__init__
(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.

__init__
(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.


list[T]

type

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

Methods

append
(x) -> None

Appends given param to the end of the list.

__getitem__
(i) -> T

Returns list element at given index.

Example
nums = [40, 41, 42, 43]
meaning_of_life = nums[2]  # returns 42 (this implicitly calls `nums.__getitem__(2)`)
Method __getitem__ should never be called directly, instead list_obj[key] syntax should be used.
__setitem__
(i, x) -> None

Assigns value to some_list[key].

Example
nums = [40, 41, 42, 43]
nums[2] = 100500  # this implicitly calls `nums.__setitem__(2, 100500)`
                  # and now `nums` are [40, 41, 100500, 43]
Method __setitem__ should never be called directly, instead list_obj[key] = value syntax should be used.
__delitem__
(i) -> None

Delete an item from the list at the given index.

Example
nums = [40, 41, 42, 43]
del nums[2]  # this implicitly calls `nums.__delitem__(2)`
Method __delitem__ should never be called directly, instead del list_obj[key] syntax should be used.
__delslice__
(start, stop, step) -> None

Delete a slice from the list.

Example
nums = [40, 41, 42, 43]
del nums[0:2]  # this implicitly calls `nums.__delslice__(0, 2, 1)`
Method __delslice__ should never be called directly, instead del list_obj[slice] syntax should be used.
__len__
() -> int

Returns the length (the number of items) of a list[T].

Example
nums = [40, 41, 42, 43]
len(nums)  # returns 4 (this implicitly calls `nums.__len__()`)
Method __len__ should never be called directly, instead len(list_obj) syntax should be used.
__bool__
() -> bool

Returns True if the list is not empty.

__contains__
(x) -> bool

Returns True if the list contains the given value, otherwise False.

Example
nums = [40, 41, 42, 43]
my_bool = 41 in nums  # this implicitly calls `nums.__contains__(41)`
Method __contains__ should never be called directly, instead val in lst syntax should be used.
remove
(x) -> None

Removes the first item from list s where s[i] is equal to given param.

Example
nums = [40, 41, 42, 40, 41, 42]
nums.remove(42)  # now `nums` are [40, 41, 40, 41, 42]
pop
(i) -> T

Retrieves the item at given index and also removes it from the list.

Example
nums = [40, 41, 42, 43]
meaning_of_life = nums.pop(2)  # now `nums` are [40, 41, 43], `meaning_of_life` is 42
insert
(i, x) -> None

Insert a value at the specified index.

Example
nums = [40, 41, 42, 43]
nums.insert(2, 50)  # now `nums` are [40, 41, 50, 42, 43]
clear
() -> None

Remove all items from the list.

Example
nums = [40, 41, 42, 43]
nums.clear()  # now `nums` is []
reverse
() -> None

Reverses the elements of the list in place.

index
(x) -> int

Returns index of the first occurrence of the item in the list. If not found returns -1.

__getslice__
(start, stop, step) -> list[T]

Returns a slice of the list elements.

Example
nums = [40, 41, 42, 43]
meaning_of_life = nums[1:3]  # returns [41, 42] (this implicitly calls `nums.__getslice__(1, 3, 1)`)
Method __getslice__ should never be called directly, instead list_obj[slice] syntax should be used.
__setslice__
(start, stop, step, new_list) -> None

Assigns given list to some_list[slice].

Example
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]
Method __setslice__ should never be called directly, instead list_obj[slice] = other_list syntax should be used.
copy
() -> list[T]

Returns a copy of the list.

extend
(l) -> None

Extends the list by appending elements from the given list.

__add__
(l) -> list[T]

Returns a concatenation of two lists.

Example
nums1 = [40, 41]
nums2 = [42, 43]
nums3 = nums1 + nums2  # this implicitly calls `nums1.__add__(nums2)`
Method __add__ should never be called directly, instead list1 + list2 syntax should be used.
__mul__
(n) -> list[T]

Returns a concatenation of the list with n its copies.

Example
nums1 = [40, 41]
nums2 = nums1 * 3  # this implicitly calls `nums1.__mul__(3)`
                   # and now `nums2` is [40, 41, 40, 41, 40, 41]
Method __mul__ should never be called directly, instead lst * n syntax should be used.
Example
# 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]`

NoneType

type

Builtin Indie type (similar to Python’s NoneType type).


str

type

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

Methods

__len__
() -> int

Returns the length (the number of characters) of a str.

Example
s = 'foobar'
len(s)  # returns 6 (this implicitly calls `s.__len__()`)
Method __len__ should never be called directly, instead len(str_obj) syntax should be used.
__init__
(x) -> None

Cast constructor for built-in Indie type. Returns a str version of object.

__init__
(x) -> None

Cast constructor for built-in Indie type. Returns a str version of object.

__init__
(x) -> None

Cast constructor for built-in Indie type. Returns a str version of object.

__init__
(x) -> None

Cast constructor for built-in Indie type. Returns a str version of object.

__contains__
(s) -> bool

Returns True if the string contains the given substring, otherwise False.

Example
my_bool = 'cd' in 'abcdef'  # this implicitly calls `'abcdef'.__contains__('cd')`
Method __contains__ should never be called directly, instead str1 in str2 syntax should be used.
__add__
(s) -> str

Returns a concatenation of two strings.

Example
str1 = 'ab'
str2 = 'cf'
str3 = str1 + str2  # this implicitly calls `str1.__add__(str2)`
Method __add__ should never be called directly, instead str1 + str2 syntax should be used.
__mul__
(n) -> str

Returns a concatenation of the string with n its copies.

Example
my_str = 'abc'
my_str2 = 'abc' * 3  # this implicitly calls `'abc'.__mul__(3)`
                     # and now `my_str2` is 'abcabcabc'
Method __mul__ should never be called directly, instead my_str * n syntax should be used.
__getitem__
(i) -> str

Returns substring at given index.

Example
my_str = 'abc'
substr = my_str[1]  # returns "b" (this implicitly calls `my_str.__getitem__(1)`)
Method __getitem__ should never be called directly, instead my_str[key] syntax should be used.
capitalize
() -> str

Returns the string with the first letter capitalized.

center
(length, character) -> str

Centers the string within the specified width using a fill character.

count
(value, start, end) -> int

Returns the count of non-overlapping occurrences of a substring within [start, end].

endswith
(value, start, end) -> bool

Returns True if the string ends with the suffix, otherwise False.

find
(value, start, end) -> int

Returns the lowest index where the substring is found.

Use the find() method to get the position of a substring. To check for its presence, use the in operator.
index
(value, start, end) -> int

Returns the lowest index of the substring within [start, end], raising an error if not found.

isalpha
() -> bool

Returns True if the string contains only alphabetic characters and is not empty; otherwise, False.

islower
() -> bool

Returns True if all cased characters are lowercase and there is at least one, otherwise False.

isspace
() -> bool

Returns True if the string contains only whitespace and is not empty, otherwise False.

isupper
() -> bool

Returns True if all cased characters are uppercase and there is at least one, otherwise False.

join
(l) -> str

Returns a string that joins the elements of the list, using the string as a separator.

ljust
(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.

lower
() -> str

Returns a copy of the string with all cased characters in lowercase.

lstrip
(symbols) -> str

Returns a copy of the string with leading characters removed.

partition
(s) -> list[str]

Splits the string at the first occurrence of sep and returns a list with the parts before, the separator, and after.

replace
(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.

rfind
(value, start, end) -> int

Returns the highest index of sub within [start, end], or -1 if not found.

rindex
(value, start, end) -> int

Returns the highest index of sub within [start, end], raising an error if not found.

rjust
(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.

rpartition
(s) -> list[str]

Splits the string at the last occurrence of sep and returns a list with the parts before, the separator, and after.

rsplit
(separator, maxsplit) -> list[str]

Splits the string into words using sep as the delimiter, with an optional maxsplit from the right.

rstrip
(symbols) -> str

Returns a copy of the string with trailing characters removed.

split
(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.

startswith
(value, start, end) -> bool

Returns True if string starts with the prefix, otherwise False.

strip
(symbols) -> str

Returns a string with the leading and trailing characters removed.

swapcase
() -> str

Returns a copy of the string with case swapped.

upper
() -> str

Returns a copy of the string with all cased characters in uppercase.


tuple[...]

type

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