[Python-Dev] Request for Pronouncement: PEP 441 - Improving Python ZIP Application Support

Paul Moore p.f.moore at gmail.com
Mon Feb 23 22:42:25 CET 2015


On 23 February 2015 at 21:18, Serhiy Storchaka <storchaka at gmail.com> wrote:
> On 23.02.15 22:51, Paul Moore wrote:
>>
>> BTW, while I was looking at the API, I realised I don't like the order
>> of arguments in pack(). I'm tempted to make it pack(directory,
>> target=None, interpreter=None, main=None) where a target of None means
>> "use the name of the source directory with .pyz tacked on", exactly as
>> for the command line API.
>
>
> If the order of arguments is not obvious, make them keyword-only.

To be honest, I don't think it *is* that non-obvious. I just think I
got it wrong initially.

With the new API, you have

pack('myappdir')
pack('myappdir', 'named_target.pyz')

Seems obvious enough to me. It matches the "source, destination" order
of similar functions like shutil.copy. And you can use a named
argument if you're not sure. But I don't think it's worth forcing it.

Paul


More information about the Python-Dev mailing list