d4265d7cbd
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> |
||
---|---|---|
.. | ||
README.md |
Built-in Functions
{:.no_toc}
* TOC {:toc}The goal
Do I need to know what all these functions are doing? No, but you are shouldn't use these function names for your own functions!
Questions to David Rotermund
abs() | Return the absolute value of a number. |
aiter() | Return an asynchronous iterator for an asynchronous iterable. |
all() | Return True if all elements of the iterable are true (or if the iterable is empty). |
anext() | When awaited, return the next item from the given asynchronous iterator, or default if given and the iterator is exhausted. |
any() | Return True if any element of the iterable is true. If the iterable is empty, return False. |
ascii() | As repr(), return a string containing a printable representation of an object, but escape the non-ASCII characters in the string |
bin() | Convert an integer number to a binary string prefixed with “0b”. |
bool() | Return a Boolean value, i.e. one of True or False. |
breakpoint() | This function drops you into the debugger at the call site. |
bytearray() | Return a new array of bytes. |
bytes() | Return a new “bytes” object which is an immutable sequence of integers in the range 0 <= x < 256. |
callable() | Return True if the object argument appears callable, False if not. If this returns True, it is still possible that a call fails, but if it is False, calling object will never succeed. |
chr() | Return the string representing a character whose Unicode code point is the integer i. |
classmethod() | Transform a method into a class method. |
compile() | Compile the source into a code or AST object. Code objects can be executed by exec() or eval(). source can either be a normal string, a byte string, or an AST object. |
complex() | Return a complex number with the value real + imag*1j or convert a string or number to a complex number. |
delattr() | This is a relative of setattr(). |
dict() | Create a new dictionary. |
dir() | Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object. |
divmod() | Take two (non-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. |
enumerate() | Return an enumerate object. iterable must be a sequence, an iterator, or some other object which supports iteration. |
eval() | The expression argument is parsed and evaluated as a Python expression (technically speaking, a condition list) using the globals and locals dictionaries as global and local namespace. |
exec() | This function supports dynamic execution of Python code. |
filter() | Construct an iterator from those elements of iterable for which function is true. |
float() | Return a floating point number constructed from a number or string x. |
format() | Convert a value to a “formatted” representation, as controlled by format_spec. |
frozenset() | Return a new frozenset object, optionally with elements taken from iterable. |
getattr() | Return the value of the named attribute of object. name must be a string. |
globals() | Return the dictionary implementing the current module namespace. |
hasattr() | The arguments are an object and a string. The result is True if the string is the name of one of the object’s attributes, False if not. |
hash() | Return the hash value of the object (if it has one). Hash values are integers. They are used to quickly compare dictionary keys during a dictionary lookup. |
help() | Invoke the built-in help system. (This function is intended for interactive use.) |
hex() | Convert an integer number to a lowercase hexadecimal string prefixed with “0x”. |
id() | Return the “identity” of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id() value. |
input() | If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. |
int() | Return an integer object constructed from a number or string x, or return 0 if no arguments are given. |
isinstance() | Return True if the object argument is an instance of the classinfo argument, or of a (direct, indirect, or virtual) subclass thereof. If object is not an object of the given type, the function always returns False. If classinfo is a tuple of type objects (or recursively, other such tuples) or a Union Type of multiple types, return True if object is an instance of any of the types. |
issubclass() | Return True if class is a subclass (direct, indirect, or virtual) of classinfo. A class is considered a subclass of itself. |
iter() | Return an iterator object. |
len() | |
list() | |
locals() | |
map() | |
max() | |
memoryview() | |
min() | |
next() | |
object() | |
oct() | |
open() | |
ord() | |
pow() | |
print() | |
property() | |
range() | |
repr() | |
reversed() | |
round() | |
set() | |
setattr() | |
slice() | |
sorted() | |
staticmethod() | |
str() | |
sum() | |
super() | |
tuple() | |
type() | |
vars() | |
zip() | |
__import__() |