You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of deprecating imp, need to move imp.get_magic() to importlib where it now belongs. Will be exposed as an attribute instead of a function, though.
As part of deprecating imp, need to move imp.get_magic() to importlib where
it now belongs. Will be exposed as an attribute instead of a function,
though.
So what are your arguments to making it more accessible? The typical user won't need to use it so I don't know if it really requires being off of importlib directly like find_loader, import_module, or (eventually) reload (which for convenience-sake while at the interpreter should be there).
While I'm happy to entertain the argument that it should be importlib.machinery.MAGIC (like the file suffixes for the various file types) instead of importlib.abc.SourceLoader.magic, I don't want to make it importlib.magic.
Any chance I could get a response to my questions, Barry, soon? I think I can finish the rest of the issues related to deprecating imp this weekend if we can settle this quickly.
The only argument I have about it is that if someone *does* want to use, it should be fairly easily discoverable. Also, since it's a concrete value, it seems a little weird that it's stashed in an abc.
I suppose importlib.machinery.MAGIC is better than importlib.abc.SourceLoader.magic
Activity
brettcannon commentedon Jun 11, 2013
As part of deprecating imp, need to move imp.get_magic() to importlib where it now belongs. Will be exposed as an attribute instead of a function, though.
brettcannon commentedon Jun 11, 2013
This could be an attribute on importlib.machinery.SourceLoader instead of an attribute in importlib.util.
warsaw commentedon Jun 11, 2013
On Jun 11, 2013, at 08:44 PM, Brett Cannon wrote:
so, importlib.magic ?
warsaw commentedon Jun 11, 2013
I'd like to see it be more easily accessible.
brettcannon commentedon Jun 12, 2013
So what are your arguments to making it more accessible? The typical user won't need to use it so I don't know if it really requires being off of importlib directly like find_loader, import_module, or (eventually) reload (which for convenience-sake while at the interpreter should be there).
While I'm happy to entertain the argument that it should be importlib.machinery.MAGIC (like the file suffixes for the various file types) instead of importlib.abc.SourceLoader.magic, I don't want to make it importlib.magic.
brettcannon commentedon Jun 14, 2013
Any chance I could get a response to my questions, Barry, soon? I think I can finish the rest of the issues related to deprecating imp this weekend if we can settle this quickly.
warsaw commentedon Jun 14, 2013
The only argument I have about it is that if someone *does* want to use, it should be fairly easily discoverable. Also, since it's a concrete value, it seems a little weird that it's stashed in an abc.
I suppose importlib.machinery.MAGIC is better than importlib.abc.SourceLoader.magic
brettcannon commentedon Jun 14, 2013
I'll put it into importlib.util.MAGIC.
warsaw commentedon Jun 14, 2013
On Jun 14, 2013, at 07:53 PM, Brett Cannon wrote:
+1
python-dev commentedon Jun 14, 2013
New changeset 5619bc2d8207 by Brett Cannon in branch 'default':
Issue bpo-18192: Introduce importlib.util.MAGIC_NUMBER and document the
http://hg.python.org/cpython/rev/5619bc2d8207