[issue37623] namedtuple integration for importlib.abc.Loader

2019-08-04 Thread Andrew Yurisich
Andrew Yurisich added the comment: If anyone is interested in the progress I was able to make as a result of this discussion, feel free to check out https://github.com/captain-kark/python-module-resources/blob/d85453ff4f5022127874a5842449d95bb5eda234/module_resources/module_resources.py and

[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-19 Thread Andrew Yurisich
Andrew Yurisich added the comment: This issue was raised due to a misunderstanding of the namedtuple creation process. After creating the fields, but before assigning them, __spec__ is trivially added to namedtuple class' definition as a property. Thanks again @serhiy.stor

[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-19 Thread Andrew Yurisich
Andrew Yurisich added the comment: You're right, I was invoking the namedtuple on the same line that I was defining it, freezing it in the process. I split it to into two statements, and snuck the __spec__ attribute between the definition and the instantiation. I'll update the exam

[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-18 Thread Andrew Yurisich
New submission from Andrew Yurisich : I wanted to return a namedtuple from a concrete implementation of an importlib.abc.Loader base class, and wasn't able to provide a __spec__ property on the underlying class behind the namedtuple. All return values from importlib.abc.Loader#create_m