Bug#625509: (no subject)

Barry Warsaw barry at python.org
Wed Jun 13 18:47:37 UTC 2012


On Jun 13, 2012, at 06:26 PM, Colin Watson wrote:

>> Meta-question: do you think it makes sense to turn on `from __future__
>> import unicode_literals`?
>
>We've talked about this on a few occasions. :-)

I know.  I just can't seem to let this go. :)

>This is more or less the poster child for a case where I think
>unicode_literals is difficult.  There's a complex API which is quite
>sensitive to whether things are bytes or unicode in places, and often
>handles both.  The tests need to check whether both are handled.  It
>interacts with several other interfaces that prefer to work with bytes
>in Python 2 but Unicode strings in Python 3.
>
>In short, I did try, but I found it to be much more complicated to try
>to shift to unicode_literals than it was worth, and I really wasn't
>confident enough in absolute 100% test coverage to be certain I hadn't
>broken anything.

Agreed, thanks for the explanation!

Everything looks great; just one last suggestion.

diff --git a/lib/debian/deb822.py b/lib/debian/deb822.py
index 4c5b74e..7e8d0a6 100644
--- a/lib/debian/deb822.py
+++ b/lib/debian/deb822.py
> @@ -246,6 +246,8 @@ class Deb822Dict(object, UserDict.DictMixin):
>          # If we got here, everything matched
>          return True
>  
> +    __hash__ = None
> +

I think it would useful to include a comment for why this is here.  It's a
relatively obscure corner of the language, so it'll be helpful for the next
person reading the code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20120613/dd58d7e5/attachment.pgp>


More information about the pkg-python-debian-maint mailing list