Pylons/pyramid_cookbook — comment on commit db4773fa6a764249ffd26694daf81ec5ea614a13
File:  line 0
By keson:

for python3 mapply function should start like this (because of renamed function attributes):

def mapply(self, ob, positional, keyword):

f = ob
im = False
if hasattr(f, '__func__'):
im = True

elif not hasattr(f, '__defaults__'):
if hasattr(f, '__call__'):
f = f.__call__
if hasattr(f, '__func__'):
im = True

if im:
f = f.__func__
c = f.__code__
defaults = f.__defaults__
names = c.co_varnames[1:c.co_argcount]
else:
defaults = f.__defaults__
c= f.__code__
names = c.co_varnames[:c.co_argcount]