Skip to content

Commit

Permalink
Use list slicing instead of extended iterable unpacking
Browse files Browse the repository at this point in the history
Extended iterable unpacking wasn't added until PEP 3132 and so isn't in
Python 2, which is causing the Python 2.7 tests to fail. While this is
annoying, it is probably worth still supporting Python 2.7 until the
official Python 2 end of life date.

c.f. https://www.python.org/dev/peps/pep-3132/
  • Loading branch information
matthewfeickert committed Feb 12, 2018
1 parent e6326dd commit d99be1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyhf/tensor/mxnet_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def outer(self, tensor_in_1, tensor_in_2):
tensor_1_shape = tensor_in_1.shape
tensor_2_shape = tensor_in_2.shape
if len(tensor_1_shape) == 1:
tensor_1_shape = (*tensor_1_shape, 1)
tensor_1_shape = (tensor_1_shape[0], 1)
if len(tensor_2_shape) == 1:
tensor_2_shape = (*tensor_2_shape, 1)
tensor_2_shape = (tensor_2_shape[0], 1)

rows1, cols1 = tensor_1_shape
rows2, cols2 = tensor_2_shape
Expand Down

0 comments on commit d99be1f

Please sign in to comment.