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

M.-A. Lemburg wrote:
> Whether you write:
> 
> {PyObject_HEAD_INIT(0), 0, ...
> 
> or
> 
> {PyVarObject_HEAD_INIT(0, 0), ...
> 
> for your type definition doesn't really make much difference. 

Actually in Py 3 it does.  If you use the former (which is how Py 2 does
it) then you get serious compiler warnings due to misaligned fields in
Py 3 and presumably even worse if run the code.  See PEP 3123 as to why
things changed.  That is why all the code in Python 3 was changed from
using the former to the latter.

> However, the macros exist to be used for both variable size
> and fixed size objects, so having both available is useful and
> legitimate.
...
> Except maybe a few thousand extensions already using it which are
> waiting to be ported to Python 3.

Can you point to any?  All the ones I found (via Google) only use
PyObject_HEAD_INIT for PyTypeObjects and every single one of those will
have to change to using PyVarObject_HEAD_INIT.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkklu7UACgkQmOOfHg372QTZBQCgt3kwtUYF3Us8hjPAS2PvDtpm
l+EAoJUata+K55mboNB0UpMsLlzoRpnA
=WbrQ
-----END PGP SIGNATURE-----

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to