We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 84ac684 + a9a8ff2 commit fdc9543Copy full SHA for fdc9543
theano/gof/tests/test_op.py
@@ -39,7 +39,10 @@ def __repr__(self):
39
def filter(self, x, strict=False, allow_downcast=None):
40
# Dummy filter: we want this type to represent strings that
41
# start with `self.thingy`.
42
- assert isinstance(x, basestring) and x.startswith(self.thingy)
+ if not isinstance(x, basestring):
43
+ raise TypeError("Invalid type")
44
+ if not x.startswith(self.thingy):
45
+ raise ValueError("Invalid value")
46
return x
47
48
class MyOp(Op):
0 commit comments