You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing type inference in mpi4py, I noticed that code like the
one below is failing in the last line. It seems that in Py>=2.6,
Python makes a coercion on "kw" and builds an actual dict instance
before calling.
class Foo:
def view(self, **kw):
print (kw)
for k in kw.keys():
print (k)
Foo().view(a=0, b=1, c=2)
class MyDict(object):
def __getitem__(self, k):
assert k == 'a'
return 7
def keys(self):
return ['a']
Foo().view(**MyDict()) # <-- Here is the issue
See http://www.mail-archive.com/cython-dev@codespeak.net/msg08051.html and http://bugs.python.org/issue1686487
Migrated from http://trac.cython.org/ticket/470
The text was updated successfully, but these errors were encountered: