gl...@divmod.com wrote:

My preference would be that

   message.headers['Subject'] = b'Some Bytes'

would simply raise an exception. If you've got some bytes, you should instead do

   message.bytes_headers['Subject'] = b'Some Bytes'

Remind me again why you need to differentiate between headers and bytes_headers?

I think bytes headers are evil. If you don't know the encoding when you have one, who does or ever will?

message.headers['Subject'] = Header(bytes=b'Some Bytes', encoding='utf-8')

Explicit is better than implicit, right?

Indeed, and the case for the above would be to keep indempotence of incoming messages in applications like mailman...

...otherwise we could just decode them and be done with it.

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
           - http://www.simplistix.co.uk
_______________________________________________
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

Reply via email to