Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit d91d980

Browse files
committed
fix pep issues
1 parent 1caa808 commit d91d980

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

numba_typing/tests/test_type_annotations.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ def test_add_vals_to_signature(self):
109109
vals = {'a': {'name': 3}, 'b': 3}
110110

111111
expected = type_annotations.Signature(parameters=[{'a': Dict[float, int], 'b': int},
112-
{'a': Dict[str, int], 'b': int},
113-
{'a': Dict[float, str], 'b': int},
114-
{'a': Dict[str, str], 'b': int}],
115-
defaults={'a': {'name': 3}, 'b': 3})
112+
{'a': Dict[str, int], 'b': int},
113+
{'a': Dict[float, str], 'b': int},
114+
{'a': Dict[str, str], 'b': int}],
115+
defaults={'a': {'name': 3}, 'b': 3})
116116

117117
result = type_annotations.add_vals_to_signature(signature, vals)
118118

@@ -178,14 +178,14 @@ def test_product_annotations(self):
178178
'c': [T, bool], 'd': [int]}, {'d': 3})
179179

180180
expected = type_annotations.Signature(parameters=[{'a': int, 'b': Dict[int, float], 'c': int, 'd': int},
181-
{'a': str, 'b': Dict[str, float], 'c': str, 'd': int},
182-
{'a': int, 'b': Dict[int, bool], 'c': int, 'd': int},
183-
{'a': str, 'b': Dict[str, bool], 'c': str, 'd': int},
184-
{'a': int, 'b': Dict[int, float], 'c': bool, 'd': int},
185-
{'a': str, 'b': Dict[str, float], 'c': bool, 'd': int},
186-
{'a': int, 'b': Dict[int, bool], 'c': bool, 'd': int},
187-
{'a': str, 'b': Dict[str, bool], 'c': bool, 'd': int}],
188-
defaults={'d': 3})
181+
{'a': str, 'b': Dict[str, float], 'c': str, 'd': int},
182+
{'a': int, 'b': Dict[int, bool], 'c': int, 'd': int},
183+
{'a': str, 'b': Dict[str, bool], 'c': str, 'd': int},
184+
{'a': int, 'b': Dict[int, float], 'c': bool, 'd': int},
185+
{'a': str, 'b': Dict[str, float], 'c': bool, 'd': int},
186+
{'a': int, 'b': Dict[int, bool], 'c': bool, 'd': int},
187+
{'a': str, 'b': Dict[str, bool], 'c': bool, 'd': int}],
188+
defaults={'d': 3})
189189

190190
result = type_annotations.product_annotations(annotations)
191191

numba_typing/type_annotations.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
Signature = namedtuple('Signature', ['parameters', 'defaults'])
88

9+
910
def get_func_annotations(func):
1011
"""Get annotations and default values of the fuction parameters."""
1112
sig = signature(func)
@@ -82,9 +83,7 @@ def get_internal_typevars(sig):
8283
unique_typevars.update(get_typevars(typ))
8384

8485
if len(unique_typevars) == 0:
85-
result = []
86-
result.append(sig)
87-
return result
86+
return [sig]
8887

8988
return expand_typevars(sig, unique_typevars)
9089

0 commit comments

Comments
 (0)