Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Python/Sympy/sympy/polys/matrices/     Datei vom 6.10.2026 mit Größe 1 kB image not shown  

Quelle  dfm.py   Sprache: Python

 

"""
sympy.polys.matrices.dfm

Provides the :class:`DFM` class if ``GROUND_TYPES=flint'``. Otherwise, ``DFM``
is a placeholder class that raises NotImplementedError when instantiated.
"
""
from __future__ import annotations

from sympy.external.gmpy import GROUND_TYPES

if GROUND_TYPES == "flint":  # pragma: no cover
    # When python-flint is installed we will try to use it for dense matrices
    # if the domain is supported by python-flint.
    from ._dfm import DFM

else: # pragma: no cover
    # Other code should be able to import this and it should just present as a
    # version of DFM that does not support any domains.
    class DFM_dummy:
        """
        Placeholder class for DFM when python-flint is not installed.
        "
""
        def __init__(*args, **kwargs):
            raise NotImplementedError("DFM requires GROUND_TYPES=flint.")

        @classmethod
        def _supports_domain(cls, domain):
            return False

        @classmethod
        def _get_flint_func(cls, domain):
            raise NotImplementedError("DFM requires GROUND_TYPES=flint.")

    # mypy really struggles with this kind of conditional type assignment.
    # Maybe there is a better way to annotate this rather than type: ignore.
    DFM = DFM_dummy # type: ignore

Messung
CHZG
1001008996

¤ Dauer der Verarbeitung: 0.2 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland