[issue11231] bytes() constructor is not correctly documented

2011-12-17 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Oooh, I missed the important sentence Accordingly, constructor arguments are 
interpreted as for bytearray(). The 5 constructors are documented in bytearray 
doc:

http://docs.python.org/dev/library/functions.html#bytearray

--
resolution:  - works for me
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-12-17 Thread brendel

brendel brice.be...@gmail.com added the comment:

Here is a patch for the docstring of bytes and bytesarray.

--
nosy: +brendel
Added file: http://bugs.python.org/file23989/patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-12-17 Thread brendel

Changes by brendel brice.be...@gmail.com:


Removed file: http://bugs.python.org/file23989/patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-12-17 Thread brendel

Changes by brendel brice.be...@gmail.com:


Added file: http://bugs.python.org/file23990/patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-12-17 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset beac7d6c7be4 by Victor Stinner in branch '3.2':
Issue #11231: Fix bytes and bytearray docstrings
http://hg.python.org/cpython/rev/beac7d6c7be4

New changeset dc670add1e28 by Victor Stinner in branch 'default':
Issue #11231: Fix bytes and bytearray docstrings
http://hg.python.org/cpython/rev/dc670add1e28

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-02-18 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-02-18 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

You sort of left out bytes() == bytes(0) == b''.
I did not know about case 5 -- not surprisingly ;-).

--
nosy: +terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-02-17 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

There are 5 different usages of the bytes() constructor:

1) bytes(iterable_of_ints) - bytes
2) bytes(string, encoding[, errors]) - bytes
3) bytes(bytes_or_buffer) - immutable copy of bytes_or_buffer
4) bytes(memory_view) - bytes
5) bytes(int) = b'\0' * size

The docstring describes the four first usages, the documentation only (3).
http://docs.python.org/dev/library/functions.html#bytes

Note: bytes(3) accepts 2 other arguments, but I don't think that they are used: 
bytes(3, 'unused encoding', 'unused errors').

--
assignee: docs@python
components: Documentation
messages: 128739
nosy: docs@python, haypo
priority: normal
severity: normal
status: open
title: bytes() constructor is not correctly documented
versions: Python 3.1, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-02-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 3) bytes(bytes_or_buffer) - immutable copy of bytes_or_buffer
 4) bytes(memory_view) - bytes

These are AFAIR the same.

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11231] bytes() constructor is not correctly documented

2011-02-17 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 These are AFAIR the same.

So the docstring should also maybe be updated too:

$ python
 help(bytes)
Help on class bytes in module builtins:

class bytes(object)
 |  bytes(iterable_of_ints) - bytes
 |  bytes(string, encoding[, errors]) - bytes
 |  bytes(bytes_or_buffer) - immutable copy of bytes_or_buffer
 |  bytes(memory_view) - bytes
 |  
 |  Construct an immutable array of bytes from:
 |- an iterable yielding integers in range(256)
 |- a text string encoded using the specified encoding
 |- a bytes or a buffer object
 |- any object implementing the buffer API.
 |  
...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com