patchwork icon indicating copy to clipboard operation
patchwork copied to clipboard

Clean-up: Avoid constructing Contexts with args[0], db, args[1], …

Open rmoehn opened this issue 7 years ago • 2 comments

There are several places in the code where a Context is constructed from datastore contents like this:

        all_successors = [Context(args[0], db, args[1], parent=args[2])
                for args in answer_successors + workspace_successors]

Replace these with something more readable.

This includes the args[0] in the procedure _can_advance_promise in context.py.

rmoehn avatar Jul 03 '18 00:07 rmoehn

The same goes for hypertext.Subquestion. Make it a namedtuple or a Python 3.7 dataclass.

rmoehn avatar Jul 11 '18 22:07 rmoehn

The construction of Workspaces is similarly repetitive.

rmoehn avatar Sep 21 '18 04:09 rmoehn