-
-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note first, in passing, that `isinstance(type(action), type)` is a tautology. But, that aside, what this code seems to be trying to do is check whether the `action` is either a class representing a subclass of Task or a function of either zero or one arguments. In the latter case it wants to make a new subclass of Task that invokes the function when executed. However, the function wrapping code can't possibly work unless I'm deeply missing something: In the `__init__` method of `FuncTask` the args parameter containing the positional arguments to `__init__` has to be either empty or contain one argument. However TaskBase in task.py defines an `__init__` that takes two positional arguments. So any attempt to construct an instance of `FuncTask` would fail: if passed zero or one arguments, the call to `super(FuncTask, self).__init__(...)` will fail because the super constructer needs two positional arguments and if called with more than one arguments it will raise an `AssertionError` itself. It's possible that the code was meant to refer to the args in the enclosing scope but, unless I'm very confused about Python, it does not so this code must never be used so might as well be deleted. Testing Done: Travis-CI. Bugs closed: 1295 Reviewed at https://rbcommons.com/s/twitter/r/1960/
- Loading branch information
1 parent
d828ece
commit 1ccd3ee
Showing
4 changed files
with
17 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters