[Twisted-Python] Twisted for Python 3

Antoine Pitrou solipsis at pitrou.net
Wed Oct 19 08:00:06 MDT 2011


On Wed, 19 Oct 2011 09:41:36 -0400
Itamar Turner-Trauring <itamar at itamarst.org> wrote:
> On Wed, 2011-10-19 at 09:25 -0400, Itamar Turner-Trauring wrote:
> 
> > I notice you have banana getting extra op code for bytes... I think a
> > better solution is to use existing 'string' op code for bytes, and
> > rejecting unicode strings.
> 
> Just to emphasize this: the current solution of having a new opcode for
> bytes makes Perspective Broker on Python 3 incompatible with PB on
> Python 2.

Or rather, they're compatible until you use Python 3 bytes objects.

(and I think any RPC system will have the same issues between 2.x and
3.x, regardless of whether it's based on pickle, json or even protocol
buffers)

This probably deserves more thinking. I took the most natural approach
for Python 3. The solution you are proposing (not supporting the 3.x
"str" type) would be, IMHO, worse, because the str type is fundamental
and basically no idiomatic Python 3 code could work.

Regards

Antoine.






More information about the Twisted-Python mailing list