MCPcopy
hub / github.com/pandas-dev/pandas / make_invalid_op

Function make_invalid_op

pandas/core/ops/invalid.py:59–77  ·  view source on GitHub ↗

Return a binary method that always raises a TypeError. Parameters ---------- name : str Returns ------- invalid_op : function

(name: str)

Source from the content-addressed store, hash-verified

57
58
59def make_invalid_op(name: str) -> Callable[..., NoReturn]:
60 """
61 Return a binary method that always raises a TypeError.
62
63 Parameters
64 ----------
65 name : str
66
67 Returns
68 -------
69 invalid_op : function
70 """
71
72 def invalid_op(self: object, other: object = None) -> NoReturn:
73 typ = type(self).__name__
74 raise TypeError(f"cannot perform {name} with this index type: {typ}")
75
76 invalid_op.__name__ = name
77 return invalid_op

Callers 2

MultiIndexClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected