[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 23:55:25 CEST 2013
Barry A. Warsaw added the comment:
On Apr 01, 2013, at 09:04 PM, Brett Cannon wrote:
>If Eric doesn't have anything to add then I would like to change
>importlib.abc.Loader.module_repr() to no longer be abstract and the default
>to be defined as ``return repr(module)``. Else it should be entirely optional
>and not have a default implementation, but having it be required as abstract
>doesn't seem quite right to me.
I have no problem making it non-abstract, but I don't think you need to define
a default. The built-in module object already does the right thing by
default. Maybe that's why we (mistakenly?) made it abstract. We might have
hoped to document the API but not provide a default implementation, since if
module_repr() is not both defined and callable, moduleobject.c already does
the right thing.
But at least there are unit tests so it should be hard for you to break
things. :)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17566>
_______________________________________
More information about the Python-bugs-list
mailing list