[docs] Python 2.7: inconsistency in "Extending Python with C or C++" example code

Georg Brandl georg at python.org
Fri Nov 26 12:56:17 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 22.11.2010 05:24, schrieb Fred Drake:
> On Fri, Nov 12, 2010 at 2:27 PM, Jani Poikela <poppis.poikela at gmail.com> wrote:
>> in chapters 1.1 and 1.3 the example code has:
>>    return Py_BuildValue("i", sts);
>> whereas chapter 1.2 example code has:
>>    return PyLong_FromLong(sts);
> 
> I suspect this is simply style changing over time.  My own preference
> is to use PyLong_FromLong(...), since that executes slightly less code
> than the Py_BuildValue(...) approach, and I find it more readable as
> well.

I've now put in PyLong_FromLong everywhere.

Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iEYEARECAAYFAkzvoGEACgkQN9GcIYhpnLDVegCfSmYR0up2irnX2ojt6Ct5m2SR
/2QAoJN53j2NTapTNbtTEGu7DFdpRUiE
=+3C7
-----END PGP SIGNATURE-----


More information about the docs mailing list