| ▲ | matsemann 8 hours ago | |||||||
How is the typing support? We just had downtime because a change to a celery task didn't trigger mypy to complain for all call sites until runtime. Too many python decorators aren't written with pretty weak typing support. | ||||||||
| ▲ | roam 7 hours ago | parent | next [-] | |||||||
With regards to args and kwargs? None. Your callable is basically replaced with a Task instance that’s not callable. You need to invoke its enqueue(*args, **kwargs) method and yeah… that’s of course not typed. | ||||||||
| ▲ | 8 hours ago | parent | prev | next [-] | |||||||
| [deleted] | ||||||||
| ▲ | halfcat 7 hours ago | parent | prev [-] | |||||||
Static analysis will never be fully robust in Python. As a simple example, you can define a function that only exists at runtime, so even in principle it wouldn’t be possible to type check that statically, or even know what the call path of the functions is, without actually running the code in trace/profiler mode. You probably want something like pydantic’s @validate_call decorator. | ||||||||
| ||||||||