Carl Meyer <c...@oddbird.net> added the comment:

Making `source_to_code` a staticmethod on the `InspectLoader` abc but not in 
the `importlib.machinery` implementation causes awkwardness for anyone trying 
to inherit `SourceFileLoader` and override `source_to_code` in typechecked 
code, since typeshed assumes that `SourceFileLoader` actually implements the 
`importlib.abc.FileLoader` interface.

Given the ABC registration, it seems that 
`importlib.machinery.SourceFileLoader` should in fact implement the 
`importlib.abc.FileLoader` interface.

Should we make `SourceFileLoader.source_to_code` a staticmethod also? If so, I 
can file a separate bug for that.

----------
nosy: +carljm

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue21156>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to