joshuaulrich/pack

Add ability to use Python-style templates

开放

#2 创建于 2015年3月2日

 (0 条评论) (0 个反应) (0 位负责人)R (2 个派生)github user discovery
help wanted

仓库指标

星标
 (1 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Currently, only perl-style templates are supported. It would be nice to support python-style templates.

It's not clear what is the best way to provide this functionality. A global option (via options) is undesirable because it makes reproducibility more difficult. Making pack and unpack generic and dispatching on a template class seems overkill. Adding an argument could be confusing, since the template and the argument might not agree.

Perhaps the easiest way is to let users start the template string with the template type? For example, pack("pl A4 C v", 2, 8, 'sequence'). The "pl" prefix would denote a perl-style template. A "py" prefix would denote a python-style template.

贡献者指南