[issue17566] Document that importlib.abc.Loader.module_repr is abstract and thus needed by various other ABCs

Barry A. Warsaw report at bugs.python.org
Mon Apr 1 21:59:23 CEST 2013


Barry A. Warsaw added the comment:

On Apr 01, 2013, at 07:40 PM, Brett Cannon wrote:

>Barry, Eric: can you clarify why you made module_repr an abstractmethod and
>thus require its overloading?

Maybe Eric can, but I can't. ;) I honestly don't remember why we made it
abstract, except perhaps because we put it in the Loader class which already
had an abstract load_module() method.

>It seems like its default is fine and you should only need to overload it
>when you can say something better than the default.

Note that moduleobject.c can handle the case of a missing or uncallable
module_repr() attribute.  Then it implements the defaults specified in PEP
420.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17566>
_______________________________________


More information about the Python-bugs-list mailing list