On 12/1/12, Matevz Bradac <[email protected]> wrote: > Thanks for the suggestion, but unfortunately it won't work on the > instance level. =/
:'( > The Stream class is using __slots__, so most instance attributes are > read-only, e.g. this: > import types > stream.render = types.MethodType(new_render, stream) > doesn't work - AttributeError exception. > I see . > Brane suggested monkeypatching on a class/module level, so maybe > genshi.core.Stream.serialize(), > or even genshi.output.get_serializer() would be good candidates. > that's risky . I'd really suggest to try to solve this at stream level since monkey patching at module level may be a serious matter . FWIW ... most of the time I advocate for wrapping rather than monkey patching , because it's easier to deal with the impact and scope of the changes . -- Regards, Olemis. Blog ES: http://simelo-es.blogspot.com/ Blog EN: http://simelo-en.blogspot.com/ Featured article:
