msgpack/msgpack-python — pull request #20 by jnothman (2012-09-22 13:11:11+00:00)
Title: Unpacker.skip()

Here is an `Unpacker.skip()` (as in msgpack-ruby), implemented by making what were `msgpack_unpack_callback` calls now dependent on a boolean `construct` argument.

Unfortunately, this adds a small overhead of checking `construct`'s value for every object construction. Ideally, the `template_execute` function would be bifurcated at compile time into `template_execute` (or `template_execute`) and `template_execute` (or `template_skip`). I'm not practiced enough at C to know how to do this without copying code slabs (hints welcome!).

(Alternatively, the `unpacker.c` code in msgpack-ruby looks like a much cleaner implementation altogether, where skip is defined as a separate driver loop around the same helpers.)