On Thu, 2008-10-09 at 06:56 -0700, Taylor wrote:
[...]
> My question is: is there any way to do this without wasting the time
> of a loop that just writes the values and keys into a new dict that I
> actually can pass as a keyword argument? This doesn't seem like a
> crazy request.  I have my data in nice keyword/value pairs, why should
> I have to loop through them just to pass them to a function?

The "why" is because Python has a limitation that requires keyword
arguments to have str type and not merely basestring type. There's
conflicting requirements here: using unicode strings throughout and
Python's requirement on keyword arguments. The latter lost out, in the
sense that you have to make the conversion yourself, since using strings
generally is a much broader use-case and you will almost always want to
use them as proper strings (not having to worry about encoding and
decoding -- hence we make them unicode objects) than just passing them
as keyword arguments to functions.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to