[PATCH 1 of 7 V2] util: add a macro initializing CPython modules

Jun Wu quark at fb.com
Fri May 19 11:45:12 EDT 2017


Excerpts from Gregory Szorc's message of 2017-05-18 15:14:45 -0700:
> The duplicate code for module init already exists. This series just adds to
> it.

Previously there are 6 places with the duplication. Now it's just 1.

> 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.
> 
> Let's not make perfect the enemy of good.

To make progress, I'll drop this series from patchwork and revive my very
first series with "_version" changed to "version".


More information about the Mercurial-devel mailing list