Brett Cannon added the comment: Giving Eric is polymorphic first argument to types.ModuleType() is going to be tricky thanks to the fact that it is not hard-coded anywhere in the C code nor documented that the first argument must be a string (the only way it might come up is from PyModule_GetName() and even then that's not required to work as you would expect). And since we purposefully kept specs type-agnostic, you can't do a type check for a SimpleNamespace.
I think the only way for it to work is by attribute check (e.g. is 'name' or 'loader' defined on the object, regardless of value). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20383> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com