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.
bool
T is SomeNumber
1 parent 50156e6 commit 3da7e86Copy full SHA for 3da7e86
src/pylib/pybool.nim
@@ -65,7 +65,7 @@ template toBool*[T](arg: T): bool =
65
# If we have len proc for this object
66
when compiles(arg.len):
67
arg.len > 0
68
- elif T is SomeNumber:
+ elif system.`is`(arg, SomeNumber):
69
# If we can compare if it's not 0
70
arg != 0 # works for NaN
71
# If we can compare if it's greater than 0
@@ -78,7 +78,7 @@ template toBool*[T](arg: T): bool =
78
arg != None
79
elif compiles(bool(arg)):
80
bool(arg)
81
- elif T is Option:
+ elif system.`is`(T, Option):
82
arg.optionToBool
83
else:
84
# XXX: is this correct?
0 commit comments