New submission from Brett Cannon:

I'm contemplating adding an implementation of 
importlib.abc.InspectLoader.get_code() which relies on get_source() (and then 
another version in ExecutionLoader which uses get_filename()). The reason I'm 
hesitant is get_source() is often an expensive operation thanks to having to 
decode the source code and do a universal newline conversion.

Now I could add the implementation but leave the method abstract, forcing users 
to make the decision to call super().get_code(), although that's still easy 
enough that I'm afraid people still won't take into consideration the 
performance implications.

But maybe I'm worrying too much? We're consenting adults, right? So for that 
reason I'm leaning towards implementing but leaving abstract with a note in the 
docs that performance should be considered before just blindly calling the 
abstract method.

----------
components: Library (Lib)
messages: 190143
nosy: brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
status: open
title: Add an implementation of importlib.abc.InspectLoader.get_code
versions: Python 3.4

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

Reply via email to