simp_le icon indicating copy to clipboard operation
simp_le copied to clipboard

Simplify IOPlugin.Data initialization

Open zenhack opened this issue 9 years ago • 0 comments

Issue by Lekensteyn Friday Jan 08, 2016 at 00:01 GMT Originally opened as https://github.com/kuba/simp_le/pull/63


Remove the need to specify every component of Data. This introduces a new IOPlugin.PersistedData member which is the same as IOPlugin.Data, except that it is initialized with boolean False instead of None.

Also remove account_key and key from FullChainFile, it is not stored by ChainFile. Replace a weird IOPlugin.EMPTY_DATA._replace(key=X) hack by the more intuitive Data(key=X).

The __defaults__ construct is taken from http://stackoverflow.com/a/18348004 and documented in https://docs.python.org/2/reference/datamodel.html and https://docs.python.org/3/reference/datamodel.html


Lekensteyn included the following code: https://github.com/kuba/simp_le/pull/63/commits

zenhack avatar Jan 03 '17 00:01 zenhack