Index: Doc/library/functions.rst =================================================================== --- Doc/library/functions.rst (revision 88501) +++ Doc/library/functions.rst (working copy) @@ -97,8 +97,8 @@ *errors*) parameters; :func:`bytearray` then converts the string to bytes using :meth:`str.encode`. - * If it is an *integer*, the array will have that size and will be - initialized with null bytes. + * If it is a non-negative *integer*, the array will have that size and will + be initialized with null bytes. * If it is an object conforming to the *buffer* interface, a read-only buffer of the object will be used to initialize the bytes array. Index: Objects/bytearrayobject.c =================================================================== --- Objects/bytearrayobject.c (revision 88501) +++ Objects/bytearrayobject.c (working copy) @@ -2790,12 +2790,16 @@ }; PyDoc_STRVAR(bytearray_doc, -"bytearray(iterable_of_ints) -> bytearray\n\ +"bytearray() -> empty bytearray == bytearray(b'')\n\ +bytearray(count) -> bytearray with count null bytes\n\ +bytearray(iterable_of_ints) -> bytearray\n\ bytearray(string, encoding[, errors]) -> bytearray\n\ bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray\n\ bytearray(memory_view) -> bytearray\n\ \n\ Construct an mutable bytearray object from:\n\ + - nothing\n\ + - a non-negative integer\n\ - an iterable yielding integers in range(256)\n\ - a text string encoded using the specified encoding\n\ - a bytes or a bytearray object\n\ Index: Objects/bytesobject.c =================================================================== --- Objects/bytesobject.c (revision 88501) +++ Objects/bytesobject.c (working copy) @@ -2723,12 +2723,16 @@ } PyDoc_STRVAR(bytes_doc, -"bytes(iterable_of_ints) -> bytes\n\ +"bytes() -> empty bytes == b''\n\ +bytes(count) -> array of count null bytes == b'\x00'*count\n\ +bytes(iterable_of_ints) -> bytes\n\ bytes(string, encoding[, errors]) -> bytes\n\ bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\n\ bytes(memory_view) -> bytes\n\ \n\ Construct an immutable array of bytes from:\n\ + - nothing\n\ + - a non-negative integer\n\ - an iterable yielding integers in range(256)\n\ - a text string encoded using the specified encoding\n\ - a bytes or a buffer object\n\