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 Arfrever, aronacher, brett.cannon, eric.araujo, eric.snow, flox, ncoghlan, tshepang, yselivanov
Date 2014-05-26.06:14:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401084880.24.0.748292383152.issue21235@psf.upfronthosting.co.za>
In-reply-to
Content
How about this replacement for direct use of Loader.load_module():

# in importlib.util
def load(spec_or_name, /, **kwargs):  # or "load_from_spec"
    if isinstance(spec_or_name, str):
        name = spec_or_name
        if not kwargs:
            raise TypeError('missing loader')
        spec = spec_from_loader(name, **kwargs)
    else:
        if kwargs:
            raise TypeError('got unexpected keyword arguments')
        spec = spec_or_name
    return _SpecMethods(spec).load()

(See a similar proposal for new_module() in msg219135, issue #20383).
History
Date User Action Args
2014-05-26 06:14:40eric.snowsetrecipients: + eric.snow, brett.cannon, ncoghlan, aronacher, eric.araujo, Arfrever, flox, tshepang, yselivanov
2014-05-26 06:14:40eric.snowsetmessageid: <1401084880.24.0.748292383152.issue21235@psf.upfronthosting.co.za>
2014-05-26 06:14:40eric.snowlinkissue21235 messages
2014-05-26 06:14:40eric.snowcreate