@@ -584,8 +584,6 @@ def __imatmul__(self, other):
584584
585585 Is used with ``a @= b``.
586586
587- Note: The matmul symbol (``@``) only works in Python 3.5+. Otherwise you must
588- call ``__imatmul__(other)``.
589587 '''
590588 new_value = self .__matmul__ (other )
591589 self .columns = new_value .columns
@@ -602,8 +600,6 @@ def __matmul__(self, other):
602600
603601 Is used with ``a @ b``.
604602
605- Note: The matmul symbol (`@`) only works in Python 3.5+. Otherwise you must
606- call ``__matmul__(other)``.
607603 '''
608604 if not isinstance (other , Matrix ):
609605 raise PyrtlError ('error: expecting a Matrix, '
@@ -736,16 +732,15 @@ def get_value(ix):
736732 col = mat_ix % self .columns
737733 self [row , col ] = get_value (v_ix )
738734
739- def reshape (self , * newshape , ** order ):
740- ''' Create a matrix of the given shape from the current matrix.
735+ def reshape (self , * newshape , order : str = "C" ):
736+ '''Create a matrix of the given shape from the current matrix.
741737
742738 :param int/ints/tuple[int] newshape: shape of the matrix to return;
743739 if a single int, will result in a 1-D row-vector of that length;
744740 if a tuple, will use values for number of rows and cols. Can also
745741 be a varargs.
746- :param str order: ``C`` means to read from self using
747- row-major order (C-style), and ``F`` means to read from self
748- using column-major order (Fortran-style).
742+ :param order: ``C`` means to read from self using row-major order (C-style), and
743+ ``F`` means to read from self using column-major order (Fortran-style).
749744 :return: A copy of the matrix with same data, with a new number of rows/cols
750745
751746 One shape dimension in newshape can be -1; in this case, the value
@@ -766,10 +761,8 @@ def reshape(self, *newshape, **order):
766761 matrix.reshape(4, 2) == [[0, 1], [2, 3], [4, 5], [6, 7]]
767762 matrix.reshape(-1, 2) == [[0, 1], [2, 3], [4, 5], [6, 7]]
768763 matrix.reshape(4, -1) == [[0, 1], [2, 3], [4, 5], [6, 7]]
764+
769765 '''
770- # python2 does not support named arguments after *args, so we use
771- # **kwargs for 'order' and set the default here.
772- order = order .get ('order' , 'C' )
773766 count = self .rows * self .columns
774767 if isinstance (newshape , int ):
775768 if newshape == - 1 :
0 commit comments