We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lots of assignments could have better error messages.
>>> arr = fsarray([cyan('hello'), 'there!']) >>> arr.dumb_display() hello there! >>> arr[1:2] = 'goodbye' Traceback (most recent call last): File "<input>", line 1, in <module> arr[1:2] = 'goodbye' File "/Users/tomb/src/curtsies/curtsies/formatstringarray.py", line 147, in __setitem__ raise ValueError('if slice is 2D, value must be 2D') ValueError: if slice is 2D, value must be 2D >>> arr[1:2, 3:4] = 'x' >>> arr[1:2, 3:4] = ['x'] >>> arr[1:3, 3:4] = ['x'] Traceback (most recent call last): File "<input>", line 1, in <module> arr[1:3, 3:4] = ['x'] File "/Users/tomb/src/curtsies/curtsies/formatstringarray.py", line 169, in __setitem__ raise ValueError('row dimensions do not match: %r, %r' % (len(value), rowslice)) ValueError: row dimensions do not match: 1, slice(1, 3, None) >>> arr[1:3, 3:4] = 'x' Traceback (most recent call last): File "<input>", line 1, in <module> arr[1:3, 3:4] = 'x' File "/Users/tomb/src/curtsies/curtsies/formatstringarray.py", line 169, in __setitem__ raise ValueError('row dimensions do not match: %r, %r' % (len(value), rowslice)) ValueError: row dimensions do not match: 1, slice(1, 3, None) >>> arr[1:3, :] = ['abcdefg', 'hijklmn'] Traceback (most recent call last): File "<input>", line 1, in <module> arr[1:3, :] = ['abcdefg', 'hijklmn'] File "/Users/tomb/src/curtsies/curtsies/formatstringarray.py", line 171, in __setitem__ [fs.setslice_with_length(colslice.start, colslice.stop, v, self.num_columns) for fs, v in zip(self.rows[rowslice], value)] + File "/Users/tomb/src/curtsies/curtsies/formatstringarray.py", line 171, in <listcomp> [fs.setslice_with_length(colslice.start, colslice.stop, v, self.num_columns) for fs, v in zip(self.rows[rowslice], value)] + File "/Users/tomb/src/curtsies/curtsies/formatstring.py", line 334, in setslice_with_length assert len(result) <= length AssertionError >>>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Lots of assignments could have better error messages.
The text was updated successfully, but these errors were encountered: