<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, May 13, 2017 at 9:44 PM, Yuya Nishihara <span dir="ltr"><<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, 13 May 2017 21:08:59 -0700, Jun Wu wrote:<br>
> Excerpts from Yuya Nishihara's message of 2017-05-14 12:57:57 +0900:<br>
> > > +        (void)postinit; \<br>
><br>
> This line could be changed to:<br>
><br>
>                if ((postinit) == -1) \<br>
>                        return; \<br>
<br>
</span>Yea.<br>
<span class=""><br>
> > Maybe I'm a bit conservative about a macro use, but my concern here is,<br>
> > it's so easy to make postinint never be called.<br>
> ><br>
> >   PYMODULEINIT(parsers, methods, parsers_doc, 1, check_python_version(),<br>
> >                module_init)<br>
><br>
> Then it will get a warning: comparison between pointer and integer.<br>
><br>
> I think the benefit of code de-duplication is worth a complex marco. The<br>
> code using the macro won't get changed frequently so I won't worry too much<br>
> about it being used wrongly.<br>
<br>
</span>That could be a counter argument. Since it's a boilerplate code we won't<br>
change too often, code duplication is just okay. That's my opinion.<br></blockquote><div><br></div><div>The duplicate code for module init already exists. This series just adds to it.</div><div><br></div><div>I'm fine with either continuing to dupe minor things, including adding a version check. Or, we can add a macro for just the version checking and call it 2x. Or, we can establish a convention for defining a "postinit" function per module, invoke that 2x as part of the boilerplate, and have each module's implementation call a helper or macro to do version checking.</div><div><br></div><div>Let's not make perfect the enemy of good.<br></div></div></div></div>