This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 't/32174/doctests__detect__safe__external_features_even_…
…if____optional_external__is_not_used' into t/32881/feature_for_sage_rings_padics
- Loading branch information
Showing
32 changed files
with
492 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
def all_features(): | ||
r""" | ||
Return an iterable of all features. | ||
EXAMPLES:: | ||
sage: from sage.features.all import all_features | ||
sage: sorted(all_features(), key=lambda f: f.name) # random | ||
[...Feature('sage.combinat')...] | ||
""" | ||
import pkgutil | ||
import importlib | ||
import sage.features | ||
# Following https://packaging.python.org/guides/creating-and-discovering-plugins/#using-namespace-packages | ||
for finder, name, ispkg in pkgutil.iter_modules(sage.features.__path__, sage.features.__name__ + "."): | ||
module = importlib.import_module(name) | ||
try: | ||
af = module.all_features | ||
except AttributeError: | ||
pass | ||
else: | ||
if af != all_features: | ||
yield from af() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.