Without an argument, an array of size 0 is created.
+ See also :ref:`binaryseq` and :ref:`typebytearray`.
+
.. _func-bytes:
.. function:: bytes([source[, encoding[, errors]]])
Bytes objects can also be created with literals, see :ref:`strings`.
+ See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`.
+
.. function:: callable(object)
method; if the value returned is equal to *sentinel*, :exc:`StopIteration`
will be raised, otherwise the value will be returned.
+ See also :ref:`typeiter`.
+
One useful application of the second form of :func:`iter` is to read lines of
a file until a certain line is reached. The following example reads a file
until the :meth:`readline` method returns an empty string::
:noindex:
Rather than being a function, :class:`list` is actually a mutable
- sequence type, as documented in :ref:`typesseq`.
+ sequence type, as documented in :ref:`typesseq-list` and :ref:`typesseq`.
.. function:: locals()
:noindex:
Rather than being a function, :class:`range` is actually an immutable
- sequence type, as documented in :ref:`typesseq`.
+ sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`.
.. function:: repr(object)
:noindex:
Rather than being a function, :class:`tuple` is actually an immutable
- sequence type, as documented in :ref:`typesseq`.
+ sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`.
.. function:: type(object)
...
>>> X = type('X', (object,), dict(a=1))
+ See also :ref:`bltin-type-objects`.
+
.. function:: vars([object])