Test whether an object is an instance of a built-in numeric type.
(x)
| 15 | return isinstance(x, int) |
| 16 | |
| 17 | def isnum(x): |
| 18 | """Test whether an object is an instance of a built-in numeric type.""" |
| 19 | for T in int, float, complex: |
| 20 | if isinstance(x, T): |
| 21 | return 1 |
| 22 | return 0 |
| 23 | |
| 24 | def isRat(x): |
| 25 | """Test whether an object is an instance of the Rat class.""" |
no outgoing calls
no test coverage detected
searching dependent graphs…