From f063fcbdb41694fd2c142b47d9259954eaa52b83 Mon Sep 17 00:00:00 2001 From: Shen Zhou Date: Fri, 28 Jul 2023 12:11:11 +0200 Subject: [PATCH] fix: inconsistency between doc and code --- doc/source/user/basics.dispatch.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/user/basics.dispatch.rst b/doc/source/user/basics.dispatch.rst index a493ef769dbe..fecdc77a9644 100644 --- a/doc/source/user/basics.dispatch.rst +++ b/doc/source/user/basics.dispatch.rst @@ -96,10 +96,10 @@ For this example we will only handle the method ``__call__`` ... elif isinstance(input, self.__class__): ... scalars.append(input._i) ... if N is not None: -... if N != self._N: +... if N != input._N: ... raise TypeError("inconsistent sizes") ... else: -... N = self._N +... N = input._N ... else: ... return NotImplemented ... return self.__class__(N, ufunc(*scalars, **kwargs)) @@ -147,10 +147,10 @@ conveniently by inheriting from the mixin ... elif isinstance(input, self.__class__): ... scalars.append(input._i) ... if N is not None: -... if N != self._N: +... if N != input._N: ... raise TypeError("inconsistent sizes") ... else: -... N = self._N +... N = input._N ... else: ... return NotImplemented ... return self.__class__(N, ufunc(*scalars, **kwargs)) @@ -186,10 +186,10 @@ functions to our custom variants. ... elif isinstance(input, self.__class__): ... scalars.append(input._i) ... if N is not None: -... if N != self._N: +... if N != input._N: ... raise TypeError("inconsistent sizes") ... else: -... N = self._N +... N = input._N ... else: ... return NotImplemented ... return self.__class__(N, ufunc(*scalars, **kwargs))