Repository navigation
Commit 1163594
committed
BUG: longdouble op None could cause infinite recursion
This is the second half of the fix for numpygh-1296 (trac 698).
None + np.longdouble(3) would cause either a RunTimeError or
an interpreter crash. The swapped case (np.longdouble(3) + None)
was fixed in 2008 (376d483).
When writing binary operators in C, they must treat both arguments
equivalently because they will be called for both __op__ and
__rop__. This bug fix is necessary because the longdouble and
clongdouble operators did not maintain this symmetry.1 parent 3509704 commit 1163594
2 files changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
740 | 743 | | |
741 | 744 | | |
742 | 745 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
527 | 535 | | |
528 | 536 | | |
529 | 537 | | |
0 commit comments