[issue9076] Remove PyUnicode_AsDecodedObject/Unicode and PyUnicode_AsEncodedObject/Unicode?

2010-06-25 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

STINNER Victor wrote:
 
 New submission from STINNER Victor victor.stin...@haypocalc.com:
 
 The following 4 functions are public but not documented and not used in 
 Python3:
  - PyUnicode_AsDecodedObject(), PyUnicode_AsEncodedObject()
  - PyUnicode_AsDecodedUnicode(), PyUnicode_AsEncodedUnicode()
 
 In Python2, PyUnicode_AsDecodedObject() was used by unicode.decode() method, 
 but Python3 has no more str.decode() method (see the recent discussion on 
 python-dev mailing list about .transform() / .untransform()).
 
 In Python2, unicode.encode() uses PyUnicode_AsEncodedObject(), but in Python3 
 str.encode() uses PyUnicode_AsEncodedString() which ensures that the result 
 type is bytes.
 
 PyUnicode_AsDecodedUnicode() and PyUnicode_AsEncodedUnicode() were added by 
 Marc-Andre Lemburg in r63986. These functions may be used for .transform() / 
 .untranform() proposition, but this proposition is not yet accepted and the 
 functions are now unused.
 
 If you decide to keep one of these functions, the function have to be 
 documented.

Victor, instead of always proposing to remove APIs that don't show
up in the C-API documentation, I'd much rather like to see documentation
patches from you, instead of patches that remove the APIs themselves.

Please also remember that we are still in a transition phase from
Python2 to Python3. The fact that Python3 (currently) doesn't use
an API does not mean that there's no Python2 3rd party code out
there using them, waiting to be ported to Python3.
It also doesn't mean that the APIs are useless.

The cases you are finding are documentation bugs. I don't want to
have to go through discussions about the usefulness of the APIs
each and every time you find one of those documentation bugs.

Furthermore, the above APIs are part of the codec system and
that doesn't have anything to do with some helper methods we have
or don't have on str and bytes objects.

Please also note that all these function *are* documented in the
unicodeobject.h header file.

--
title: Remove PyUnicode_AsDecodedObject/Unicode and 
PyUnicode_AsEncodedObject/Unicode? - Remove PyUnicode_AsDecodedObject/Unicode 
and  PyUnicode_AsEncodedObject/Unicode?

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



[issue9076] Remove PyUnicode_AsDecodedObject/Unicode and PyUnicode_AsEncodedObject/Unicode?

2010-06-25 Thread Marc-Andre Lemburg

Changes by Marc-Andre Lemburg m...@egenix.com:


--
assignee:  - d...@python
components: +Documentation -Unicode
nosy: +d...@python

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



[issue9076] Remove PyUnicode_AsDecodedObject/Unicode and PyUnicode_AsEncodedObject/Unicode?

2010-06-24 Thread STINNER Victor

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

The following 4 functions are public but not documented and not used in Python3:
 - PyUnicode_AsDecodedObject(), PyUnicode_AsEncodedObject()
 - PyUnicode_AsDecodedUnicode(), PyUnicode_AsEncodedUnicode()

In Python2, PyUnicode_AsDecodedObject() was used by unicode.decode() method, 
but Python3 has no more str.decode() method (see the recent discussion on 
python-dev mailing list about .transform() / .untransform()).

In Python2, unicode.encode() uses PyUnicode_AsEncodedObject(), but in Python3 
str.encode() uses PyUnicode_AsEncodedString() which ensures that the result 
type is bytes.

PyUnicode_AsDecodedUnicode() and PyUnicode_AsEncodedUnicode() were added by 
Marc-Andre Lemburg in r63986. These functions may be used for .transform() / 
.untranform() proposition, but this proposition is not yet accepted and the 
functions are now unused.

If you decide to keep one of these functions, the function have to be 
documented.

--
components: Unicode
files: remove_unicode_codec.patch
keywords: patch
messages: 108565
nosy: haypo, lemburg
priority: normal
severity: normal
status: open
title: Remove PyUnicode_AsDecodedObject/Unicode and 
PyUnicode_AsEncodedObject/Unicode?
versions: Python 3.2
Added file: http://bugs.python.org/file17763/remove_unicode_codec.patch

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