A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-August/102907.html below:

[Python-Dev] [Python-checkins] r83763 - in python/branches/py3k: Doc/library/signal.rst Lib/test/test_signal.py Misc/NEWS Modules/signalmodule.c

[Python-Dev] [Python-checkins] r83763 - in python/branches/py3k: Doc/library/signal.rst Lib/test/test_signal.py Misc/NEWS Modules/signalmodule.c [Python-Dev] [Python-checkins] r83763 - in python/branches/py3k: Doc/library/signal.rst Lib/test/test_signal.py Misc/NEWS Modules/signalmodule.cHirokazu Yamamoto ocean-city at m2.ccsnet.ne.jp
Sat Aug 7 15:21:54 CEST 2010
On 2010/08/07 19:18, Ronald Oussoren wrote:
>
> On 7 Aug, 2010, at 10:24, Hirokazu Yamamoto wrote:
>
>> This is the idea just popped up. :-)
>>
>> #define SIG(name) if (sig_num != SIG##name)
>>     SIG(ABRT) SIG(FPE) SIG(ILL) SIG(INT) SIG(SEGV) SIG(TERM) {
>>          PyErr_SetString(PyExc_ValueError, "signal number out of range");
>>          return NULL;
>>      }
>> #undef SIG
>
> What's wrong with:
>
> switch (sig_num) {
> case SIGABRT:
> case SIGFPE:
> ...
> case SIGTERM:
>         break;
> default:
>        PyErr_SetString(...)
>        return NULL;
> }
>
> That would IMO be clearer than the macro you propose.
>
> Ronald

Hmm... I liked the macro idea, but nothing is wrong with switch
statement.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4