[Python-Dev] Accepting PEP 3154 for 3.4?

Antoine Pitrou solipsis at pitrou.net
Mon Nov 18 17:14:21 CET 2013


On Sun, 17 Nov 2013 23:53:09 -0600
Tim Peters <tim.peters at gmail.com> wrote:
> 
> But I wonder why it isn't done with a new framing opcode instead (say,
> FRAME followed by 8-byte count).  I suppose that would be like the
> "prefetch" idea, except that framing opcodes would be mandatory
> (instead of optional) in proto 4.  Why I initially like that:
> 
> - Uniform decoding loop ("the next thing" _always_ starts with an opcode).

But it's not actually uniform. A frame isn't a normal opcode, it's a
large section of bytes that contains potentially many opcodes.

The framing layer is really below the opcode layer, it makes also sense
to implement it like that.

(I also tried to implement Serhiy's PREFETCH idea, but it didn't bring
any actual simplification)

> When slinging 8-byte counts, _some_ sanity-checking seems like a good idea ;-)

I don't know. It's not much worse (for denial of service opportunities)
than a 4-byte count, which already exists in earlier protocols.

Regards

Antoine.


More information about the Python-Dev mailing list