Skip to content

Commit c76881a

Browse files
committed
_types.py: fix lint and format errors
1 parent c7ac314 commit c76881a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/buildstream/_types.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ def set_values(mcs, kls, data):
5858
value_to_entry = {}
5959

6060
assert len(set(data.values())) == len(data.values()), "Values for {} are not unique".format(kls)
61-
assert len(set(type(value) for value in data.values())) <= 1, \
62-
"Values of {} are of heterogeneous types".format(kls)
61+
assert len(set(type(value) for value in data.values())) <= 1, "Values of {} are of heterogeneous types".format(
62+
kls
63+
)
6364

6465
for key, value in data.items():
6566
new_value = object.__new__(kls)
@@ -72,11 +73,11 @@ def set_values(mcs, kls, data):
7273

7374
type.__setattr__(kls, "_value_to_entry", value_to_entry)
7475

75-
def __repr__(self):
76-
return "<fastenum '{}'>".format(self.__name__)
76+
def __repr__(cls):
77+
return "<fastenum '{}'>".format(cls.__name__)
7778

78-
def __setattr__(self, key, value):
79+
def __setattr__(cls, key, value):
7980
raise AttributeError("Adding new values dynamically is not supported")
8081

81-
def __iter__(self):
82-
return iter(self._value_to_entry.values())
82+
def __iter__(cls):
83+
return iter(cls._value_to_entry.values())

0 commit comments

Comments
 (0)