Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread M.-A. Lemburg
On 2008-11-20 20:34, Roger Binns wrote: > 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 (whic

[Python-3000] RELEASED Python 3.0rc3

2008-11-21 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team and the Python community, I am happy to announce the third and last planned release candidate for Python 3.0. This is a release candidate, so while it is not quite suitable for production environments,

Re: [Python-3000] Using memoryviews

2008-11-21 Thread Josiah Carlson
On Thu, Nov 20, 2008 at 2:12 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > I've had a look at the new memoryview and associated buffer API > and have a question: how is a C extension supposed to use the buffer > API without going directly into the C struct Py_buffer ? > > I have not found any macr

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread Adam Olsen
On Fri, Nov 21, 2008 at 7:14 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > On 2008-11-20 20:34, Roger Binns wrote: >> 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

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread M.-A. Lemburg
On 2008-11-21 18:36, Adam Olsen wrote: > On Fri, Nov 21, 2008 at 7:14 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> On 2008-11-20 20:34, Roger Binns wrote: >>> M.-A. Lemburg wrote: Whether you write: {PyObject_HEAD_INIT(0), 0, ... or {PyVarObject_HEAD_INIT(0, 0), ... for

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread Adam Olsen
On Fri, Nov 21, 2008 at 10:53 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > On 2008-11-21 18:36, Adam Olsen wrote: >> On Fri, Nov 21, 2008 at 7:14 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >>> On 2008-11-20 20:34, Roger Binns wrote: M.-A. Lemburg wrote: > Whether you write: > {PyOb

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 M.-A. Lemburg wrote: > You might get warnings (esp. from GCC), but I have yet to see a compiler > that doesn't map the above to the same memory. They don't map the same as Adam showed. Your fields end up off by one which is why the compiler is giving

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread M.-A. Lemburg
On 2008-11-21 19:36, Adam Olsen wrote: > On Fri, Nov 21, 2008 at 10:53 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> Yes, it's a different way of writing and accessing the resp. fields. >> No, it's not a different memory layout. >> Yes, this is binary compatible. >> No, this is not going to help

Re: [Python-3000] Using memoryviews

2008-11-21 Thread M.-A. Lemburg
On 2008-11-21 17:30, Josiah Carlson wrote: > On Thu, Nov 20, 2008 at 2:12 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> I've had a look at the new memoryview and associated buffer API >> and have a question: how is a C extension supposed to use the buffer >> API without going directly into the C

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 M.-A. Lemburg wrote: > Starting with Python 3, you have to use PyVarObject_HEAD_INIT() > on PyVarObjects and PyObject_HEAD_INIT() on PyObjects. I don't > see the problem. It's just another change to remember when porting > to Python 3. The problem is

Re: [Python-3000] [Python-Dev] 2.6.1 and 3.0

2008-11-21 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Nov 19, 2008, at 3:19 PM, Terry Reedy wrote: Let's try this for 3.0rc4 then. The current release is rc2. Skipping rc3 would confuse people'-) Yeah, my calendar was wrong, but the PEP (and more importantly... code!) was right :). There is

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread Terry Reedy
Roger Binns wrote: The problem is that unless you are clairvoyant you have no way of knowing about this change. Even in rc3 the documentation shows the old (wrong) way: http://docs.python.org/dev/3.0/extending/newtypes.html PyObject_HEAD_INIT is documented: http://docs.python.org/dev/3.0

Re: [Python-3000] Using memoryviews

2008-11-21 Thread Benjamin Peterson
On Fri, Nov 21, 2008 at 1:41 PM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > > In the past, we've always tried to provide abstract access methods to > C struct internals of Python objects and I wonder whether this was > deliberately not done for Py_buffer structs or simply not considered. > > I don'

Re: [Python-3000] Using memoryviews

2008-11-21 Thread Nick Coghlan
Benjamin Peterson wrote: > On Fri, Nov 21, 2008 at 1:41 PM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> In the past, we've always tried to provide abstract access methods to >> C struct internals of Python objects and I wonder whether this was >> deliberately not done for Py_buffer structs or simpl

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-21 Thread Nick Coghlan
Terry Reedy wrote: > Roger Binns wrote: > >> The problem is that unless you are clairvoyant you have no way of >> knowing about this change. Even in rc3 the documentation shows the old >> (wrong) way: >> >> http://docs.python.org/dev/3.0/extending/newtypes.html >> >> PyObject_HEAD_INIT is docum

Re: [Python-3000] Using memoryviews

2008-11-21 Thread Benjamin Peterson
On Fri, Nov 21, 2008 at 5:34 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Benjamin Peterson wrote: >> On Fri, Nov 21, 2008 at 1:41 PM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >>> In the past, we've always tried to provide abstract access methods to >>> C struct internals of Python objects and I w