[PATCH] util: document we want Python type mapping to be temporary
Jun Wu
quark at fb.com
Sat Oct 8 17:16:18 EDT 2016
These look good to me. (Including related patches:
util: define PyInt_Type on Python 3
parsers: return NULL from PyInit_parsers on Python 3)
I think we can always iterate on Python 3 later.
Excerpts from Gregory Szorc's message of 2016-10-08 19:16:54 +0200:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1475947010 -7200
> # Sat Oct 08 19:16:50 2016 +0200
> # Node ID d15d8ac73cfd2d1ddbd443262ccad9c68ee69406
> # Parent 266ad9c9faa524a8b3f473c924db409681cb205e
> util: document we want Python type mapping to be temporary
>
> I think remapping Python C API types and functions is not a great
> approach. I'd prefer this whole #ifdef disappeared. Add a comment
> so we don't forget about it.
>
> diff --git a/mercurial/util.h b/mercurial/util.h
> --- a/mercurial/util.h
> +++ b/mercurial/util.h
> @@ -12,8 +12,11 @@
>
> #if PY_MAJOR_VERSION >= 3
>
> #define IS_PY3K
> +/* The mapping of Python types is meant to be temporary to get Python
> + * 3 to compile. We should remove this once Python 3 support is fully
> + * supported and proper types are used in the extensions themselves. */
> #define PyInt_Type PyLong_Type
> #define PyInt_FromLong PyLong_FromLong
> #define PyInt_AsLong PyLong_AsLong
>
More information about the Mercurial-devel
mailing list