Brett Cannon added the comment:

I agree with Eric: set_data() is meant to be generic so as to allow writing 
arbitrary data, not just bytecode files. So while accepting a mode argument 
makes sense and I'm fine with in terms of possible API change (in the future), 
having a source_path argument I'm not comfortable with. So I'm going to just 
take Eric's idea and commit the change. I'm also making the argument _mode just 
to make sure no one relies on it until we can discuss API changes in the 
context of Python 3.4 sine we will need to clean up the loader APIs to have 
abstract source/bytecode stuff that can play nicely with file-based APIs to 
allow for reading generic file assets once we have all of these little bugs 
worked out.

And as for why set_data() is not part of FileLoader, that's because it isn't 
necessary to load files. =) It's in SourceFileLoader purely to facilitate 
writing bytecode files, but set_data() is not used at all in terms of the 
actual loading of source code (or bytecode files for that matter).

----------

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

Reply via email to