Author serhiy.storchaka
Recipients ethan.furman, giampaolo.rodola, serhiy.storchaka
Date 2015-01-26.20:38:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2015-01-26 20:38:30serhiy.storchakasetrecipients: + serhiy.storchaka, giampaolo.rodola, ethan.furman
2015-01-26 20:38:30serhiy.storchakasetmessageid: <1422304710.21.0.213579052731.issue23325@psf.upfronthosting.co.za>
2015-01-26 20:38:30serhiy.storchakalinkissue23325 messages
2015-01-26 20:38:30serhiy.storchakacreate