declarative-parser icon indicating copy to clipboard operation
declarative-parser copied to clipboard

Consider integration with data classes (PEP 557)

Open krassowski opened this issue 6 years ago • 0 comments

As suggested by a mod of r/pythoncoding, it might be a good idea to make use of data classes as defined in recently accepted PEP 557. I would like to know if there is a demand for that before trying to implement it. It could look like:

class OutputOptions(Parser):
    format: Argument(choices=supported_formats) = 'jpeg'
    # or
    scale: Argument[int, 'Rescale image to % of original size'] = 100

NB. it would be only available with 3.7+ unless backports are provided.

krassowski avatar Dec 06 '17 03:12 krassowski