0
In [1]: l1 = lambda *args, **kw: args

In [2]: l1(**{'name':'hello'})
Out[2]: ()

In [3]: l1(**{u'name':'hello'})
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/sma/<ipython console> in <module>()

I've some problem with Python unable to pass/unpack the dictionary elements to the functions... might be my python is corrupted or system is broken don't know but this is strange

I'm using python 2.6.2 on Ubuntu 9.04 Jaunty Jacob

Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
shahjapan
  • 13,637
  • 22
  • 74
  • 104
  • 1
    I have Python 2.6.1 on Mac OS X and I get the error: *TypeError: `()` keywords must be strings* – Felix Kling Nov 18 '10 at 09:28
  • I've another system installed ubuntu 10.10 it works with python 2.6.5 !!! its really crazy - can't understand what's wrong with unicode !!! – shahjapan Nov 18 '10 at 09:29
  • Works fine for me, Python 2.6.6 on Ubuntu 10.10. I presume it's a bug which was fixed (i.e. allow key names as `basestr`, including `unicode`, not just `str`) somewhere between 2.6.1 and 2.6.5. – Chris Morgan Nov 18 '10 at 09:51

1 Answers1

2

Seems to be related with this (non-)bug (old), but there are even more bug reports and it really seems to be fixed from 2.6.5 on only.

That is all I found and I don't have more insight into Python to explain how or why ;)

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143