diff --git a/.pylintrc b/.pylintrc index 5e319a7564..0148db5544 100644 --- a/.pylintrc +++ b/.pylintrc @@ -19,9 +19,11 @@ profile=no # paths. ignore=CVS,tensorflow_serving -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. +# Add files or directories matching the regex patterns to the blacklist. +# The regex matches against base names, not paths. +# Regex patterns can be comma(and newline)-separated ignore-patterns= + .*_pb2.py, # Ignore all files generated by the protocol buffer compiler # Pickle collected data for later comparisons. persistent=yes @@ -89,7 +91,6 @@ disable= useless-object-inheritance, # TODO: Remove unnecessary imports cyclic-import, # TODO: Resolve cyclic imports no-self-use, # TODO: Convert methods to functions where appropriate - consider-using-ternary, # TODO: Consider ternary expressions too-many-branches, # TODO: Simplify or ignore as appropriate missing-docstring, # TODO: Fix missing docstring diff --git a/src/sagemaker/predictor.py b/src/sagemaker/predictor.py index d2c4822289..d1ddba38a6 100644 --- a/src/sagemaker/predictor.py +++ b/src/sagemaker/predictor.py @@ -231,7 +231,9 @@ def _is_mutable_sequence_like(obj): def _is_sequence_like(obj): # Need to explicitly check on str since str lacks the iterable magic methods in Python 2 - return (hasattr(obj, "__iter__") and hasattr(obj, "__getitem__")) or isinstance(obj, str) + return ( # pylint: disable=consider-using-ternary + hasattr(obj, "__iter__") and hasattr(obj, "__getitem__") + ) or isinstance(obj, str) def _row_to_csv(obj):