ubuiltins: Document list, tuple.

This commit is contained in:
Laurens Valk
2022-11-28 11:17:18 +01:00
parent 4bc53b17f4
commit 725b6d672c
+22 -3
View File
@@ -669,7 +669,17 @@ class list:
def __init__(self, *args) -> None:
"""
Creates a new list.
list()
list(iterable)
Creates a new list. If no argument is given, this creates an empty
``list`` object.
A list is *mutable*, which means that you *can* change its contents
after you create it.
Arguments:
iterable (iter): Iterable from which to build the list.
"""
@@ -1013,8 +1023,17 @@ class tuple:
def __init__(self, *args) -> None:
"""
Rather than being a function, :class:`tuple` is actually an immutable
sequence type.
tuple()
tuple(iterable)
Creates a new tuple. If no argument is given, this creates an empty
``tuple`` object.
A tuple is *immutable*, which means that you *cannot* change its
contents after you create it.
Arguments:
iterable (iter): Iterable from which to build the tuple.
"""