[issue45592] NamespaceLoader does not implement create_module or exec_module

2021-10-25 Thread Brett Cannon


Brett Cannon  added the comment:

create_module() being empty is on purpose: 
https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.create_module
 . You only define create_module() if you need a specific type of object for 
the module instance.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45592] NamespaceLoader does not implement create_module or exec_module

2021-10-23 Thread Filipe Laíns

New submission from Filipe Laíns :

NamespaceLoader currently does not implement create_module or exec_module, 
which is problematic since load_module is deprecated.

The create_module docstring is the same as _LoaderBasics:

```
def create_module(self, spec):
"""Use default semantics for module creation."""
```

Is it intended to be empty, or is NamespaceLoader unfinished?

If this is intended, how should we create the module instead? If there is other 
part of the code dealing this, via a fallback in case the loader does not 
implement this method, wouldn't it make sense to put that in in the loader 
itself for standalone use?

--
messages: 404913
nosy: FFY00, brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
status: open
title: NamespaceLoader does not implement create_module or exec_module

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com