[Python-Dev] Decoding incomplete unicode

M.-A. Lemburg mal at egenix.com
Wed Aug 25 10:32:41 CEST 2004


Martin v. Löwis wrote:
> Walter Dörwald wrote:
> 
>> If a tuple is passed and returned this makes it possible
>> from Python code to mangle the state. IMHO this should be
>> avoided if possible.
> 
> Not necessarily. We are all consenting adults. So if the
> code checks whether the state is sane, from a typing point
> of view, i.e. if you can't crash the interpreter, then there
> is no need to hide the state from the user.

Martin, there are two reasons for hiding away these details:

1. we need to be able to change the codec state without
    breaking the APIs

2. we don't want the state to be altered by the user

A single object serves this best and does not create
a whole plethora of new APIs in the _codecs module.
This is not over-design, but serves a reason.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 25 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list