Skip to content

lazy_import: Muffle diagnostic messages for "at_startup" #32619

@mkoeppe

Description

@mkoeppe

When loading a modularized part of Sage instead of sage.all, we should suppress the second of these two messages:

        if startup_guard and not self._at_startup:
            print(f"Resolving lazy import {self._name} during startup")
        elif self._at_startup and not startup_guard:
            print(f"Option ``at_startup=True`` for lazy import {self._name} not needed anymore")

Also, instead of print, we should use warnings.warn.

Previous discussion:

CC: @tscrim @jhpalmieri @nthiery

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: 4a8f409

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/32619

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions