Comment 82 for bug 893091

Revision history for this message
In , Barry Warsaw (barry) wrote :

On Jan 11, 2012, at 03:19 PM, <email address hidden> wrote:

>I've pushed a python3 branch based on yours to the official dbus-python
>repository; please review/test. I believe it's about ready for merging, and it
>passes tests on Python 2.6, 2.7, 3.2 under Debian sid.

Reviewed and tested on Ubuntu precise against 2.6, 2.7, and 3.2. We'll have
some experimental packages for Python 3.3 soon and I'll test them against that
when they're available, but I don't expect changes to support 3.3 pre-alpha.
(I can't test against a from-source install for dumb reasons.)

>> The semantic question is more interesting though. Just what should it mean
>> to append a byte signature with a unicode object?
>
>I concluded that the answer is "nothing", and disallowed Byte('A') in the
>Python 3 world too. You now have to use Byte(ord('A')) or Byte(b'A') if that's
>what you want. (This is consistent with ByteArray.)

Agreed.

>I also moved the Python 2 API back to how it used to be:
>
>* things that used to return str (other than __str__/__repr__) are back
> to returning str, not unicode, via NATIVESTR_FROMSTR
>
>* things that used to return int (in particular, variant levels) still
> return int, not long, via a new NATIVEINT_FROMLONG
>
>so we won't break existing Python 2 code. In Python 3, those methods return
>long or unicode, of course.
>
>I also added an INTORLONG_CHECK macro so we don't keep repeating "is it a long
>(or in Python 2, an int)?" #ifdefs.

+1 to all of these.

The branch looks great, and I appreciate all your help in getting this
landed. From me, I think it's ready to merge!

Cheers,
-Barry