rwth-i6 / sisyphus

A Workflow Manager in Python
Mozilla Public License 2.0
45 stars 24 forks source link

typing updates for Task #194

Closed albertz closed 3 months ago

albertz commented 3 months ago

Also removed Python 2 style code to derive from object.

I did not cover update_rqmt yet because this would require Protocol (not just Callable), and I'm not sure if we want that (requires Python 3.8).

michelwi commented 3 months ago

did not cover update_rqmt yet because this would require Protocol (not just Callable), and I'm not sure if we want that

Why would Callable[[Dict[str, Any], Dict[str, Any]], Dict[str, Any]] not work?

albertz commented 3 months ago

did not cover update_rqmt yet because this would require Protocol (not just Callable), and I'm not sure if we want that

Why would Callable[[Dict[str, Any], Dict[str, Any]], Dict[str, Any]] not work?

We call self._update_rqmt(last_rqmt=last_rqmt, last_usage=last_usage), i.e. we use named args, which is not supported by Callable.