On Fri, Dec 14, 2018 at 10:19 AM E. Madison Bray <
erik....@gmail.com> wrote:
>
> There is also an existing hard-coded list of function names that are
> actually what's used for dir() and tab-completion, completely separate
> from this module. AFAICT this all_documented_functions module isn't
> really used anywhere in Sage, and doesn't turn up much in the
> documentation. As Alex Konovalov pointed out to me, the "example" in
> all_documented_functions of doing `from
> sage.libs.gaps.all_documented_functions import *` is probably not a
> good idea in most cases anyways. For example:
>
> sage: DihedralGroup(8)
> Dihedral group of order 16 as a permutation group
> sage: type(_)
> <class 'sage.groups.perm_gps.permgroup_named.DihedralGroup_with_category'>
> sage: from sage.libs.gap.all_documented_functions import *
> sage: DihedralGroup(8)
> <pc group of size 8 with 3 generators>
> sage: type(_)
> <type 'sage.libs.gap.element.GapElement'>
>
> Oops, this clobbers multiple existing built-ins in Sage. Alex also
> suggested that using IsDocumentedWord like this was perhaps
> ill-considered in the first place.
>
> Given that it isn't actually used anywhere in Sage, and is not
> particularly documented, and mostly seems to cause problems, it would
> be best just to remove this? Does anyone use it?
it's used for tab completion and as well for directly calling libgap functions
(otherwise you need to call libgap's function_factory on them):
sage: libgap.SymmetricGroup(3).Order() # SymmetricGroup is in the list
6
sage: libgap.ImfMatrixGroup(12,3) # ImfMatrixGroup is not there
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-8-86e9cd3d6fbf> in <module>()
----> 1 libgap.ImfMatrixGroup(Integer(12),Integer(3))
/mnt/opt/Sage/sage-dev/local/lib/python2.7/site-packages/sage/misc/lazy_import.pyx
in sage.misc.lazy_import.LazyImport.__getattr__
(build/cythonized/sage/misc/lazy_import.c:3536)()
320 True
321 """
--> 322 return getattr(self.get_object(), attr)
323
324 # We need to wrap all the slot methods, as they are not forwarded
/mnt/opt/Sage/sage-dev/local/lib/python2.7/site-packages/sage/libs/gap/libgap.pyx
in sage.libs.gap.libgap.Gap.__getattr__
(build/cythonized/sage/libs/gap/libgap.c:6229)()
668 g = make_any_gap_element(self, gap_eval(name))
669 else:
--> 670 raise AttributeError(f'No such attribute: {name}.')
671
672 self.__dict__[name] = g
AttributeError: No such attribute: ImfMatrixGroup.
sage: libgap.function_factory('ImfMatrixGroup')(12,3) # but this works
ImfMatrixGroup(12,3)
----
Best,
Dima