Commit f967017
committed
Robust test for callable objects
- If the object implements a custom `__getattr__`, or if its `__call__`
is itself not callable, you may get misleading results.
- Instead use the built-in `callable` function. Not only is it more
robust, but it makes the intent clear and the code more readable.1 parent 74885be commit f967017
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | | - | |
| 1483 | + | |
1484 | 1484 | | |
1485 | 1485 | | |
1486 | 1486 | | |
| |||
2515 | 2515 | | |
2516 | 2516 | | |
2517 | 2517 | | |
2518 | | - | |
| 2518 | + | |
2519 | 2519 | | |
2520 | 2520 | | |
2521 | 2521 | | |
| |||
2566 | 2566 | | |
2567 | 2567 | | |
2568 | 2568 | | |
2569 | | - | |
| 2569 | + | |
2570 | 2570 | | |
2571 | 2571 | | |
2572 | 2572 | | |
| |||
0 commit comments