def others(self, other, name='other'): '''Refine the class comparison. @arg other: The other point (C{LatLon}). @kwarg name: Optional, other's name (C{str}). @raise TypeError: Incompatible B{C{other}} C{type}. ''' try: LatLonBase.others(self, other, name=name) except TypeError: if not isinstance(other, NvectorBase): raise
def others(self, other, name=_other_, up=1): '''Refine the class comparison. @arg other: The other point (C{LatLon}). @kwarg name: Optional, other's name (C{str}). @kwarg up: Number of call stack frames up (C{int}). @raise TypeError: Incompatible B{C{other}} C{type}. ''' try: LatLonBase.others(self, other, name=name, up=up + 1) except TypeError: if not isinstance(other, NvectorBase): raise
def others(self, *other, **name_other_up): '''Refined class comparison. @arg other: The other instance (C{LatLonNvectorBase}). @kwarg name_other_up: Overriding C{name=other} and C{up=1} keyword arguments. @return: The B{C{other}} if compatible. @raise TypeError: Incompatible B{C{other}} C{type}. ''' if other: other0 = other[0] if isinstance( other0, (self.__class__, LatLonNvectorBase)): # XXX NvectorBase? return other0 other, name, up = _xother3(self, other, **name_other_up) if not isinstance( other, (self.__class__, LatLonNvectorBase)): # XXX NvectorBase? LatLonBase.others(self, other, name=name, up=up + 1) return other