Nick Coghlan added the comment:

The specific reason I wanted the "return None to delegate to the default 
behaviour" feature was to make it easier to migrate the C extension machinery.

With that design, a PEP 451 based C extension loader would just need to return 
None when there was no appropriate "Create" symbol exported from the module.

If returning None was disallowed, it would need to instead arrange to call 
importlib.util.module_from_spec(). That's doable, of course, but requires 
loaders to reimplement behaviour provided by the standard import system, rather 
than being able to just say "do the default thing, whatever that happens to 
be". That's the kind of really easy to get wrong responsibility I appreciated 
PEP 451 taking *away* from custom loaders.

However, I have no problem with making create_module() mandatory if the "return 
None to request the default behaviour" feature is retained. As you say, adding 
an implementation that returns None is both easy and remains compatible with 
Python 3.4.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23014>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to