Conversation
|
This is the first time I've seem PEP484 in the wild, pretty nifty. |
mjcarroll
left a comment
There was a problem hiding this comment.
One minor Q, but looks good.
Is there an example of a launch file using this? Am I just missing it?
| from typing import List | ||
| from typing import Optional | ||
| from typing import Text | ||
| from typing import Tuple # noqa: F401 |
There was a problem hiding this comment.
Why is F401 needed here, looks like you are using Tuple?
There was a problem hiding this comment.
Because we have to support python 3.5, we cannot use the type annotation for member variables syntax which was added in 3.6. So we use the type comment, which is the only place I use Tuple. So flake8 doesn’t count that as using it so I suppressed the unused import warning.
|
There is no example using it yet. I have a couple of related features (all part of “include another launch file into a namespace”) which I wanted to finish before updating or adding new examples. |
|
I really like the type annotations. I would not use them everywhere but I caught at least ten to fifteen errors while writing the code before even running my tests. |
|
Would not* |
This fixes #105 by adding a Condition class, making Actions take them and evaluate them as the predicate for "executing" the action, and adding the
IfConditionandUnlessConditionclasses which can operate onSubstitutionclasses.See #105 for more design details and conceptual information. The idea that actions can be conditionally executed with a
Conditionis also in the architecture document (in thedocfolder).