Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 831321a

Browse files
authoredMar 13, 2019
fix Python 2 typehints that black mangled (#109)
1 parent d5352ba commit 831321a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎src/dynamodb_encryption_sdk/material_providers/aws_kms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ class KeyInfo(object):
8686
algorithm = attr.ib(validator=attr.validators.instance_of(six.string_types))
8787
length = attr.ib(validator=attr.validators.instance_of(six.integer_types))
8888

89-
def __init__(self, description, algorithm, length): # type: Text # type: Text # type: int # noqa=D107
90-
# type: (...) -> None
89+
def __init__(self, description, algorithm, length):
90+
# type: (Text, Text, int) -> None
9191
# Workaround pending resolution of attrs/mypy interaction.
9292
# https://github.com/python/mypy/issues/2088
9393
# https://github.com/python-attrs/attrs/issues/215

‎src/dynamodb_encryption_sdk/structures.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ def __attrs_post_init__(self):
141141
raise ValueError('No override behavior can be set for reserved attribute "{}"'.format(attribute.value))
142142

143143
# Enums are not hashable, but their names are unique
144-
_unique_actions = set([self.default_action.name])
145-
_unique_actions.update(set([action.name for action in self.attribute_actions.values()]))
146-
no_actions = _unique_actions == set([CryptoAction.DO_NOTHING.name])
144+
_unique_actions = {self.default_action.name}
145+
_unique_actions.update({action.name for action in self.attribute_actions.values()})
146+
no_actions = _unique_actions == {CryptoAction.DO_NOTHING.name}
147147
self.take_no_actions = no_actions # attrs confuses pylint: disable=attribute-defined-outside-init
148148

149149
def action(self, attribute_name):
@@ -222,8 +222,8 @@ class TableIndex(object):
222222
partition = attr.ib(validator=attr.validators.instance_of(six.string_types))
223223
sort = attr.ib(validator=attr.validators.optional(attr.validators.instance_of(six.string_types)), default=None)
224224

225-
def __init__(self, partition, sort=None): # type: Text # type: Optional[Text] # noqa=D107
226-
# type: (...) -> None
225+
def __init__(self, partition, sort=None):
226+
# type: (Text, Optional[Text]) -> None
227227
# Workaround pending resolution of attrs/mypy interaction.
228228
# https://github.com/python/mypy/issues/2088
229229
# https://github.com/python-attrs/attrs/issues/215

0 commit comments

Comments
 (0)
Please sign in to comment.