RealOrangeOne / django-tasks

A reference implementation and backport of background workers and tasks in Django
https://pypi.org/project/django-tasks/
BSD 3-Clause "New" or "Revised" License
211 stars 13 forks source link

Support task decorator without arguments #55

Closed jhthompson closed 2 weeks ago

jhthompson commented 2 weeks ago

Closes #48

Inspired by:

The use of @overload for typing is new to me, but comes straight from mypy's documentation on decorator factories:

Sometimes the same decorator supports both bare calls and calls with arguments. This can be achieved by combining with @overload ...

Adam's great post "Python type hints: how to use @overload" was also helpful in understanding that concept.