Re: [Python-Dev] Any PEP about 2.6 -> 3000 code transition?

2008-05-25 Thread Gregory P. Smith
Of particular interest to bsddb is the pep3118 buffer API.  I updated
the existing bsddb module found in the py3k branch to use it last
fall; you may want to use the changes made to it as an example.

I agree, a single C code base is the only sane way forward for bsddb.
The interesting part is that you also want to support older python
versions (2.3-2.5?) as well so _bsddb.c & bsddb.h become a nice
example of how to write code that spans multiple python versions.

I expect it is less difficult than it sounds.

 http://www.python.org/dev/peps/pep-3118/

I believe the buffer api is supposed to be backported to 2.6?  I
haven't followed the status of that.  If so, bsddb should use it in
2.6 as well.

-gps

On Sat, May 24, 2008 at 9:25 PM, Jesus Cea <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> I can't find any PEP about detailed 2.6 -> 3000 migration guidelines,
> specially in the module (C code) extension area. Yes, I know about the
> 2to3 tool, but I'm interested in updating my 2.x code in order to keep
> (automatic via "2to3") difference between 2.x and 3.x codebase so small
> as possible. Also, 2to3 doesn't manage migration for C modules.
>
> Since I need to port bsddb3 to py3k, what I need to know?. Is any
> *updated* document out there?.
>
> PS: My plan is keep working in the python side under 2.x, and manage
> Python 3.0 via "2to3", for a long time. In the C side, I plan keeping
> the same codebase, with conditional compilation. Ideas?.
>
> - --
> Jesus Cea Avion _/_/  _/_/_/_/_/_/
> [EMAIL PROTECTED] - http://www.jcea.es/ _/_/_/_/  _/_/_/_/  _/_/
> jabber / xmpp:[EMAIL PROTECTED] _/_/_/_/  _/_/_/_/_/
> ~   _/_/  _/_/_/_/  _/_/  _/_/
> "Things are not so easy"  _/_/  _/_/_/_/  _/_/_/_/  _/_/
> "My name is Dump, Core Dump"   _/_/_/_/_/_/  _/_/  _/_/
> "El amor es poner tu felicidad en la felicidad de otro" - Leibniz
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.8 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iQCVAwUBSDjqJplgi5GaxT1NAQLP3QP/Y2bWmNzHKsIq23dRz9sxd237TSfzbs5X
> UzEQ6Ze9Kv1lRXYRfiGjk37aOeiO4xqoKPfASc/WjMN/TmRkUNZxMQEQWwFYhmCA
> aAVqGxNMEX3KCXvRP9MkkZYLPa9RZg8boPTMYCn+uLDW1Ff2Pwj96hFKbWKG0dkJ
> RamNp8BFhkM=
> =ngK+
> -END PGP SIGNATURE-
> ___
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/greg%40krypto.org
>
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Committing bsddb 4.6.4, and where can I put testsuite temp files?

2008-05-25 Thread Gregory P. Smith
On Thu, May 22, 2008 at 1:32 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
>> I would like to print the Berkeley DB release used, also.
>
> Could that be done at build time as well?
>
> Martin

I just added that to python's setup.py as well as made test_bsddb3
print the version to stderr when it gets run.

-gps
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Any PEP about 2.6 -> 3000 code transition?

2008-05-25 Thread Stefan Behnel
Gregory P. Smith wrote:
> Of particular interest to bsddb is the pep3118 buffer API.  I updated
> the existing bsddb module found in the py3k branch to use it last
> fall; you may want to use the changes made to it as an example.
> 
> I agree, a single C code base is the only sane way forward for bsddb.
> The interesting part is that you also want to support older python
> versions (2.3-2.5?) as well so _bsddb.c & bsddb.h become a nice
> example of how to write code that spans multiple python versions.
> 
> I expect it is less difficult than it sounds.

I would say so. Most things can be done with preprocessor conditionals and
some redefinitions, e.g. "#define PyLong_Type PyInt_Type", etc.

The method "generate_module_preamble()" in Cython's ModuleNode.py source file
(from line 360 onwards) has a code block of things we found so far.

http://hg.cython.org/cython-devel/file/tip/Cython/Compiler/ModuleNode.py


> I believe the buffer api is supposed to be backported to 2.6?  I
> haven't followed the status of that.  If so, bsddb should use it in
> 2.6 as well.

The API is there (in addition to the old buffer API), but it doesn't seem to
get used.

Stefan

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


[Python-Dev] Stabilizing the C API of 2.6 and 3.0

2008-05-25 Thread Christian Heimes
Hello!

The first set of betas of Python 2.6 and 3.0 is fast apace. I like to
grab the final chance and clean up the C API of 2.6 and 3.0. I know, I
know, I brought up the topic two times in the past. But this time I mean
it for real! :]

Last time Guido said:
---
I think it can actually be simplified. I think maintaining binary
compatibility between 2.6 and earlier versions is hopeless anyway, so
we might as well just rename PyString to PyBytes in 2.6 and 3.0, and
have an extra set of macros so that code using PyString needs to be
recompiled but not otherwise touched. E.g.

typedef { ... } PyBytesObject;
#define PyStringObject PyBytesObject

... PyString_Type;
#define PyBytes_Type PyString_Type


---

I like to follow Guido's advice and change the code as following:

 * replace PyBytes_ with PyByteArray_
 * replace PyString with PyBytes_
 * rename bytesobject.[ch] to bytearrayobject.[ch]
 * rename stringobject.[ch] to bytesobject.[ch]
 * add a new file stringobject.h which contains the aliases PyString_ ->
PyBytes_

Christian
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Please svnmerge your changes

2008-05-25 Thread Christian Heimes
Hello fellow developers!

I've been busy with personal work in the past weeks. At present I'm
still moving into my new apartment. It has been a real challenge to
install an IKEA kitchen in a house built before WW2 all by myself. On
the one hand it's fun but on the other hand it costs me most of my free
time at night. At least this building has a shelter in its cellar so I'm
mostly protected in the case of an air strike. *g*

In order to get all code merged before the first betas I need your help.
Please everybody grab a couple of your checkins and merge them yourself.

You can find the list of required merges at http://rafb.net/p/cghbTk63.html

Christian
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com



Re: [Python-Dev] Stabilizing the C API of 2.6 and 3.0

2008-05-25 Thread Christian Heimes
Stefan Behnel schrieb:
> will that be included by Python.h by default?

Only in Python 2.6

Christian
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-3000] Please svnmerge your changes

2008-05-25 Thread Guilherme Polo
2008/5/25 Christian Heimes <[EMAIL PROTECTED]>:
> Hello fellow developers!
>
> I've been busy with personal work in the past weeks. At present I'm
> still moving into my new apartment. It has been a real challenge to
> install an IKEA kitchen in a house built before WW2 all by myself. On
> the one hand it's fun but on the other hand it costs me most of my free
> time at night. At least this building has a shelter in its cellar so I'm
> mostly protected in the case of an air strike. *g*
>
> In order to get all code merged before the first betas I need your help.
> Please everybody grab a couple of your checkins and merge them yourself.
>
> You can find the list of required merges at http://rafb.net/p/cghbTk63.html
>

I see there is one commit of mine that shouldn't be merged, maybe you
could remove it from there ?

> Christian

Thanks,

-- 
-- Guilherme H. Polo Goncalves
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-3000] Please svnmerge your changes

2008-05-25 Thread Christian Heimes
Guilherme Polo schrieb:
> I see there is one commit of mine that shouldn't be merged, maybe you
> could remove it from there ?

You can easily block it yourself with svnmerge.py:

py3k$ svnmerge.py block -r1234
py3k$ svn ci -F svnmerge-commit-message.txt

Christian
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Mercurial mirrors of trunk and py3k

2008-05-25 Thread Antoine Pitrou

Hello,

For those of you who have been using my Mercurial mirrors of the Python SVN
repository, I had to move them to another site as the original site has been
down for a few days for unknown reasons. Here are the new URLs:

http://hg.pitrou.net/public/cpython/trunk/
http://hg.pitrou.net/public/py3k/py3k/

If you want those to become the default pulling location, you just have to edit
the .hg/hgrc for your local clone(s) and fill in the appropriate URL.

Regards

Antoine.


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


Re: [Python-Dev] [Python-3000] Stabilizing the C API of 2.6 and 3.0

2008-05-25 Thread Brett Cannon
On Sun, May 25, 2008 at 7:59 AM, Christian Heimes <[EMAIL PROTECTED]> wrote:
> Hello!
>
> The first set of betas of Python 2.6 and 3.0 is fast apace. I like to
> grab the final chance and clean up the C API of 2.6 and 3.0. I know, I
> know, I brought up the topic two times in the past. But this time I mean
> it for real! :]
>
> Last time Guido said:
> ---
> I think it can actually be simplified. I think maintaining binary
> compatibility between 2.6 and earlier versions is hopeless anyway, so
> we might as well just rename PyString to PyBytes in 2.6 and 3.0, and
> have an extra set of macros so that code using PyString needs to be
> recompiled but not otherwise touched. E.g.
>
> typedef { ... } PyBytesObject;
> #define PyStringObject PyBytesObject
>
> ... PyString_Type;
> #define PyBytes_Type PyString_Type
>
> 
> ---
>
> I like to follow Guido's advice and change the code as following:
>
>  * replace PyBytes_ with PyByteArray_
>  * replace PyString with PyBytes_
>  * rename bytesobject.[ch] to bytearrayobject.[ch]
>  * rename stringobject.[ch] to bytesobject.[ch]
>  * add a new file stringobject.h which contains the aliases PyString_ ->
> PyBytes_

+1 from me.

-Brett
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-3000] Please svnmerge your changes

2008-05-25 Thread Brett Cannon
On Sun, May 25, 2008 at 8:28 AM, Christian Heimes <[EMAIL PROTECTED]> wrote:
> Hello fellow developers!
>
> I've been busy with personal work in the past weeks. At present I'm
> still moving into my new apartment. It has been a real challenge to
> install an IKEA kitchen in a house built before WW2 all by myself. On
> the one hand it's fun but on the other hand it costs me most of my free
> time at night. At least this building has a shelter in its cellar so I'm
> mostly protected in the case of an air strike. *g*
>
> In order to get all code merged before the first betas I need your help.
> Please everybody grab a couple of your checkins and merge them yourself.
>
> You can find the list of required merges at http://rafb.net/p/cghbTk63.html

For stuff from the sandbox, would it help at all to block them
explicitly even though they shouldn't get merged at all?

-Brett
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com