[I18n-sig] XML and codecs
Walter Doerwald
walter@livinglogic.de
Wed, 06 Jun 2001 16:52:36 +0200
On 05.06.01 at 11:02 M.-A. Lemburg wrote:
> Walter Doerwald wrote:
> >
> [...]
>
> > > This scheme is very simple, but also very effective, since
> > > it allows complex error processing to be done in the
> > > namespace where the data is being processed (rather than
> > > in a callback which wouldn't have access to this namespace).
> >
> > A callback could be a class instance with a __call__ method
> > and so can have as much state information as it needs.
>
> Sure, but it breaks the current API completely. The above
> mechanism is different in that the communication in the error
> case is done by means of an exception. While this is not as
> fast as a callback it does have some advantages:
>
> * you can write the error handling code in the context using
> the codec
>
> * it enables you to write error handling code at higher levels
> in the calling stack
But this means that you would have to allow the encoder to keep
state between calls. That's no isse with a callback, because there
is only one call.
> * it fits in with the current API
That's right. Unfortunately there are a lot of functions that
would have to be changed.
Bye,
Walter D=F6rwald
--
Walter D=F6rwald =B7 LivingLogic AG =B7 Bayreuth, Germany =B7
www.livinglogic.de