Skip to content

Move imp.get_magic() to importlib #62392

Closed

Description

@brettcannon
BPO 18192
Nosy @warsaw, @brettcannon

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/brettcannon'
closed_at = <Date 2013-06-14.23:03:12.452>
created_at = <Date 2013-06-11.20:44:04.897>
labels = ['library']
title = 'Move imp.get_magic() to importlib'
updated_at = <Date 2013-06-14.23:03:12.452>
user = 'https://github.com/brettcannon'

bugs.python.org fields:

activity = <Date 2013-06-14.23:03:12.452>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2013-06-14.23:03:12.452>
closer = 'brett.cannon'
components = ['Library (Lib)']
creation = <Date 2013-06-11.20:44:04.897>
creator = 'brett.cannon'
dependencies = []
files = []
hgrepos = []
issue_num = 18192
keywords = []
message_count = 10.0
messages = ['190981', '190985', '190987', '190988', '191039', '191146', '191148', '191149', '191150', '191167']
nosy_count = 4.0
nosy_names = ['barry', 'brett.cannon', 'Arfrever', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue18192'
versions = ['Python 3.4']

Activity

  1. brettcannon commented on Jun 11, 2013

    @brettcannon
    MemberAuthor

    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.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Jun 11, 2013
  3. brettcannon commented on Jun 11, 2013

    @brettcannon
    MemberAuthor

    This could be an attribute on importlib.machinery.SourceLoader instead of an attribute in importlib.util.

  4. warsaw commented on Jun 11, 2013

    @warsaw
    Member

    On Jun 11, 2013, at 08:44 PM, Brett Cannon wrote:

    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, importlib.magic ?

  5. warsaw commented on Jun 11, 2013

    @warsaw
    Member

    I'd like to see it be more easily accessible.

  6. brettcannon commented on Jun 12, 2013

    @brettcannon
    MemberAuthor

    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.

  7. brettcannon commented on Jun 14, 2013

    @brettcannon
    MemberAuthor

    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.

  8. warsaw commented on Jun 14, 2013

    @warsaw
    Member

    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

  9. brettcannon commented on Jun 14, 2013

    @brettcannon
    MemberAuthor

    I'll put it into importlib.util.MAGIC.

  10. warsaw commented on Jun 14, 2013

    @warsaw
    Member

    On Jun 14, 2013, at 07:53 PM, Brett Cannon wrote:

    I'll put it into importlib.util.MAGIC.

    +1

  11. python-dev commented on Jun 14, 2013

    python-devmannequin
    Mannequin

    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

  12. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directory

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions