def get_reversemap_strsignal():
        """Strategy 2: return the name of the signal constant corresponding to
           the value passed in."""
        import signal

        signames = [None] * signal.NSIG
        for constant in dir(signal):
            if not constant.startswith("SIG"):
                continue
            if constant.startswith("SIG_"):
                continue
            # obsolete names for signals
            if constant in ('SIGIOT', 'SIGCLD', 'SIGPOLL'):
                continue
            signames[getattr(signal, constant)] = constant

        for rt in range(signal.SIGRTMIN+1, signal.SIGRTMAX):
            signames[rt] = "SIGRTMIN+"+str(rt - signal.SIGRTMIN)

        for gap in range(len(signames)):
            if signames[gap] is None:
                signames[gap] = "SIG_"+str(gap)

        NSIG = signal.NSIG
        def strsignal_reversemap_wrapper(signo):
            if 0 <= signo < NSIG:
                return signames[signo]
            else:
                return "Unknown signal "+str(signo)

        return strsignal_reversemap_wrapper
Strategy 2: return the name of the signal constant corresponding to
           the value passed in.
recipes/Python/578899_strsignal/recipe-578899.py