Skip to content

--codegen python: have normal __init__ , add method for parsing from a doc #262

@mr-c

Description

@mr-c

using @classmethod

example generated code:

class Workflow(Process):
  def __init__(self, id, inputs, outputs, requirements, hints, label, doc, steps): 
     # or use attrs, or use 3.7's dataclasses
    pass # init code here

  @staticmethod
  def from_doc(cls, doc, baseurl, loadingOptions, docRoot=None):
    pass # regular loading code here
  • Generate the __init__ as part of codegen? Or go Python3.7+ only by using @dataclass/PEP-0557?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions