This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients brett.cannon, eric.snow, ncoghlan
Date 2013-11-01.03:16:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383275813.81.0.924128062775.issue19468@psf.upfronthosting.co.za>
In-reply-to
Content
The first thing that importlib.reload() does is to verify that the passed module is an instance of types.ModuleType (Lib/importlib/__init__.py:107).  This check seems unnecessary to me.  We really don't have a functional need for the check (that I know of).  Furthermore, there has been at least one serious proposal recently that suggested using custom module types.

The only benefit that I can think of to the type check is it makes the failure more clear when someone tries to "reload" an attribute in a module (thinking just the attribute will get reloaded!).  However, does that matter all that much now that reload() is not a builtin (ergo less likely to get misused very often)?

I'm not invested in removing these 2 lines (or at least loosening the restriction).  I've brought it up simply because it keeps staring me in the face lately. :-)  If anyone has any objections, I'll drop it (at least it will be recorded here in the tracker).  That said, I'm glad to remove the restriction otherwise.
History
Date User Action Args
2013-11-01 03:16:53eric.snowsetrecipients: + eric.snow, brett.cannon, ncoghlan
2013-11-01 03:16:53eric.snowsetmessageid: <1383275813.81.0.924128062775.issue19468@psf.upfronthosting.co.za>
2013-11-01 03:16:53eric.snowlinkissue19468 messages
2013-11-01 03:16:53eric.snowcreate