Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider dropping importlib.abc.Loader.create_module() #65780

Closed
brettcannon opened this issue May 26, 2014 · 5 comments
Closed

Consider dropping importlib.abc.Loader.create_module() #65780

brettcannon opened this issue May 26, 2014 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

BPO 21581
Nosy @brettcannon, @ncoghlan
Dependencies
  • bpo-23014: Don't have importlib.abc.Loader.create_module() be optional
  • 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 2015-01-16.13:41:59.483>
    created_at = <Date 2014-05-26.14:51:37.646>
    labels = ['type-bug', 'library']
    title = 'Consider dropping importlib.abc.Loader.create_module()'
    updated_at = <Date 2015-01-16.13:41:59.482>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2015-01-16.13:41:59.482>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2015-01-16.13:41:59.483>
    closer = 'brett.cannon'
    components = ['Library (Lib)']
    creation = <Date 2014-05-26.14:51:37.646>
    creator = 'brett.cannon'
    dependencies = ['23014']
    files = []
    hgrepos = []
    issue_num = 21581
    keywords = []
    message_count = 5.0
    messages = ['219159', '219189', '219225', '232566', '234127']
    nosy_count = 3.0
    nosy_names = ['brett.cannon', 'ncoghlan', 'Arfrever']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21581'
    versions = ['Python 3.5']

    @brettcannon
    Copy link
    Member Author

    As Armin Ronacher pointed out, it's a bit odd having the importlib.abc.Loader ABC have a method whose default does nothing and having the method itself be entirely optional. Might as well just drop it from the ABC and instead just make sure that create_module() is documented appropriately (it's such an advanced use case it might also simplify things to not have it in the typical user's face).

    @brettcannon brettcannon added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels May 26, 2014
    @ncoghlan
    Copy link
    Contributor

    I suggest waiting until we update the C extension import system before making a final decision - that was the concrete use case for the feature, so it may become less confusing once that is added.

    @brettcannon
    Copy link
    Member Author

    This issue is not talking about dropping create_module() from the algorithm (I need it for the lazy loader), just from the ABC since it's a do-nothing implementation that doesn't have to be there.

    Otherwise it should be made a required method and possibly even not have its return None special-casing.

    @brettcannon
    Copy link
    Member Author

    Issue bpo-23014 is planning to make create_module() required so that module creation doesn't have a two-tiered way of specifying a default module (which is handy in C code).

    @brettcannon brettcannon self-assigned this Dec 12, 2014
    @brettcannon
    Copy link
    Member Author

    create_module() is now slated to be required in Python 3.6.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants