Message234775
In C the SIG_DFL and SIG_IGN macros expand into integral expressions that are not equal to an address of any function. In Python they are int objects with platform depended values. Second argument of the signal() function should be SIG_DFL, SIG_IGN, or a function. The getsignal() function returns SIG_DFL, SIG_IGN, None, or a function. They are tested for identity in signal() and getsignal() returns identical values. So actually SIG_DFL and SIG_IGN are just singletons.
I propose to turn SIG_DFL and SIG_IGN into functions. Benefits:
1. They will have names and self-descriptive representation.
2. They will have docstrings.
3. The signature of signal() will be simpler. The type of second argument would be function.
4. Their pickling will be portable.
This patch depends on the backout of turning these constants to enums (issue21076). |
|
Date |
User |
Action |
Args |
2015-01-26 20:38:30 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, giampaolo.rodola, ethan.furman |
2015-01-26 20:38:30 | serhiy.storchaka | set | messageid: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za> |
2015-01-26 20:38:30 | serhiy.storchaka | link | issue23325 messages |
2015-01-26 20:38:30 | serhiy.storchaka | create | |
|