On Mon, Jun 13, 2011 at 6:31 AM, Terry Reedy <tjre...@udel.edu> wrote:
> With just 1 or 2 filter fields, and very many other fields, I would just
> unpack everything, including the filter field. I expect the extra time to do
> that would be comparalbe to the extra time to combine. It certainly would
> make your code easier. I suspect you could write a function to create the
> filter field only format by field number from the everything format.

Indeed, while the "filter format" part makes sense to me, the decision
to go with field combination rather than just extracting the filter
fields a second time isn't such an obvious improvement.

OTOH, it also seems like this is something that could be published as
a cookbook recipe that generated the appropriate filtered formats on
the fly from an existing struct definition. So given format "a b c d
e", it could either extract each field individually, or else be asked
to generate specific formats and their complements (e.g, asking for
the 2nd and 3rd field could return a 2-tuple of formats "x b c x x"
and "a x x c d e").

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to