<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 17 Nov 2015 at 02:30 Raúl Cumplido <<a href="mailto:raulcumplido@gmail.com">raulcumplido@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I am preparing a talk for PyCon ES (Spanish PyCon) about the import machinery and I was taking a look on the importlib/_bootstrap.py#module_from_spec</div><div><br></div><div>I see there is a Deprecation warning as on Python3.6 loaders defining exec module must also define create module, but there is also a comment that says: "Typically loaders will not implement create_module()"</div><div><br></div><div>I see that a little bit contradictory,</div></div></blockquote><div><br></div><div>So it's not contradictory if you happen to realize the implicit ending to that comment is "... because importlib.abc.Loader defines the method."</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> what are the expected changes for the new Python3.6 version?</div></div></blockquote><div><br></div><div>Loaders must implement create_module() if they define exec_module().</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> Are the existing Loaders going to be changed to implement create_module?</div></div></blockquote><div><br></div><div>They all have since Python 3.5; remember that create_module() can return None and that will follow default semantics, so defining the method can be as short as `def create_module(self): pass`.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Sorry if this has been explained before but I cannot find in the archives the rationale for that.</div></div></blockquote><div><br></div><div><a href="https://bugs.python.org/issue23014">https://bugs.python.org/issue23014</a></div><div><br></div><div>-Brett </div></div></div>