ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tliron <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils
Date Mon, 08 May 2017 16:18:21 GMT
Github user tliron commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289271
  
    --- Diff: aria/modeling/service_template.py ---
    @@ -2131,13 +2132,15 @@ def resolve(self, model_storage):
             # moved to.
             plugins = model_storage.plugin.list()
             matching_plugins = []
    -        for plugin in plugins:
    -            # TODO: we need to use a version comparator
    -            if (plugin.name == self.name) and \
    -                    ((self.version is None) or (plugin.package_version >= self.version)):
    -                matching_plugins.append(plugin)
    +        if plugins:
    +            for plugin in plugins:
    +                if (plugin.name == self.name) and \
    --- End diff --
    
    I strongly disagree, especially in this case when there is `or` and `and` in the same
clause. Do you otherwise expect the reader to know the priority of logical binary operations?
Parentheses remove any potential confusion.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message