def main():
    Person = namedtuple('Person', 'name')
p = Person(name='joe', age=25)
print(p)

def namedtuple(typename, field_names, verbose=False, rename=False):
    base = collections.namedtuple('Base', field_names, verbose, rename)
return type(typename, (base,), {'__slots__': (), '__new__': lambda cls, *
    args, **kwargs: base.__new__(cls, *args, **{key: value for key, value in
    list(kwargs.items()) if key in base._fields})})
if __name__ == '__main__':
    main()
Заставить namedtuple принимать kwargs