Re: [Python-ideas] zipfile refactor and AES

2019-06-03 Thread Daniel Hillier
Robert Collins wrote: > Is it API compatible with the current zipfile module docs? Yes it should be (that was my intention during the refactor and if I accidentally introduced an incompatibility, I'll fix that up before I attempt to integrate the work). I had a look through the docs again and I

Re: [Python-ideas] `if-unless` expressions in Python

2019-06-03 Thread Steven D'Aprano
On Mon, Jun 03, 2019 at 08:57:22PM -0400, James Lu wrote: > `if-unless` expressions in Python > > if condition1 expr unless condition2 > > is an expression that roughly reduces to > > expr if condition1 and not condition2 else EMPTY Then the "unless" clause is superfluorous and we can

Re: [Python-ideas] `if-unless` expressions in Python

2019-06-03 Thread Chris Angelico
On Tue, Jun 4, 2019 at 10:58 AM James Lu wrote: > > `if-unless` expressions in Python > > if condition1 expr unless condition2 > > is an expression that roughly reduces to > > expr if condition1 and not condition2 else EMPTY > > This definition means that expr is only evaluated if

Re: [Python-ideas] `if-unless` expressions in Python

2019-06-03 Thread MRAB
On 2019-06-04 01:57, James Lu wrote: `if-unless` expressions in Python     if condition1 expr unless condition2 is an expression that roughly reduces to     expr if condition1 and not condition2 else EMPTY This definition means that expr is only evaluated if `condition1 and not

[Python-ideas] `if-unless` expressions in Python

2019-06-03 Thread James Lu
`if-unless` expressions in Python if condition1 expr unless condition2 is an expression that roughly reduces to expr if condition1 and not condition2 else EMPTY This definition means that expr is only evaluated if `condition1 and not condition2` evaluates to true. It also means `not

Re: [Python-ideas] zipfile refactor and AES

2019-06-03 Thread Steve Barnes
One specific pain point with zipfile is that if you zip a directory that contains the target zip file you end up trying to add the target file to itself which leads to a rapidly growing archive. From: Python-ideas On Behalf Of Robert Collins Sent: 03 June 2019 21:12 To: Daniel Hillier Cc:

Re: [Python-ideas] zipfile refactor and AES

2019-06-03 Thread Robert Collins
This sounds like a valuable refactoring to me. Is it API compatible with the current zipfile module docs? On Mon, 3 Jun 2019, 20:23 Daniel Hillier, wrote: > Hi, > > I've written a package that can read and write zip files encrypted with > Winzip's AES encryption scheme

[Python-ideas] zipfile refactor and AES

2019-06-03 Thread Daniel Hillier
Hi, I've written a package that can read and write zip files encrypted with Winzip's AES encryption scheme (https://github.com/danifus/pyzipper/). It is based on Python's zipfile module which I refactored to facilitate adding the AES code as subclasses of the classes defined in the zipfile