2 ms·
Namedtuples are pickle-able when created in the global scope, just as any dynamically created class. The main section of the collections module demonstrates tha
by xapata 9y ago
Namedtuples are pickle-able when created in the global scope, just as any dynamically created class. The main section of the collections module demonstrates that feature (read the source, Luke).
Removing eval from tuple would not solve your issue. You'd need to instead remove eval from pickle, of sorts. The trouble is that pickle tries to look up your namedtuple by name and can't find it in your module.