>> What about a new keyword argument to the constructor, "encoding". If
>> specified, *only* accept unicode (and do the conversion internally).
>
>Would that apply to keys, values, or both?

I admit that I deliberately glossed over that. 8-)

One option is to say "both", just to keep it simple: if you're doing
something funky, use the "bytes" mode and do your own encoding.

Another option would be have "key_encoding" and "value_encoding" as well,
and let them default to "encoding". I'm not so keen on this.

I think the important point is to throw an exception if the module gets
input of the wrong type, rather than trying to coerce the input. Which
implies it needs to know what mode it's in.

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to