Skip to content

Feature.require vs. is_present, is_functional #33114

@mkoeppe

Description

@mkoeppe

(addressing slabbe's questions from #33092 comment:23)

Some questions arise with respect to is_present(),
is_functional() and require():

  • why does Feature.require() not check
    that is_functional() is True?
  • should is_present() always return False
    when is_functional returns False (while
    the method names suggest is_present could
    be True while is_functional is False)?

Choices made in this ticket:

  • only is_present() should be called from outside
  • it always checks that is_functional() returns True
  • the require() method only calls is_present()

A further step, not done in this ticket, would be,
as suggested in comment:14, to rename is_functional
to _is_functional, since only is_present is supposed
to be used from outside.

CC: @seblabbe @orlitzky @kwankyu @saraedum

Component: refactoring

Author: Matthias Koeppe

Branch: f9232e8

Reviewer: Sébastien Labbé

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions