Aliases can be detected programmatically, that's how I removed them from the 
HTML docs (or more specifically, listed them as an alias with a link to the 
original instead of duplicating the docstring like we previously did) recently 
in https://github.com/sagemath/sage/pull/40753

There is a related issue to mark aliases in the interactive documentation: 
https://github.com/sagemath/sage/issues/40759

I like your suggestion not to pollute tab complete with aliases! But I don't 
think marking aliases should be a manual process or involve decorators, as that 
requires everyone to know about this and to consistently use it. It would also 
mean either a patch bomb to add the decorator to ever alias we alteady have, or 
many small patches adding them throughout the codebase. Both of those options 
are annoying.

My preference would be if whatever library/software handles tab autocomplete 
has a way to exclude things through its public API, which is however I removed 
aliases from the generated Sphinx docs. My second preference would be to 
programmatically detect them in __dir__ (perhaps in the SageObject __dir__ 
method?). I'm assuming this would have no impact on runtime performance of 
Sage, and __dir__ only gets called when the user tried to use tab autocomplete 
(if I'm wrong about how __dir__ works, then please correct me). We should 
definitely profile this change either way though if we are messing with magic 
methods of the base class of all Sage classes. I don't think tab complete 
performance itself is really a concern though. As long as it feels fast for 
users, adding even a couple milliseconds to tab autocomplete isn't an issue.

Vincent Macri (he/him)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/TO1PPFB4708EDB7212FFD1872E5A2BCE74FF7E0A%40TO1PPFB4708EDB7.CANPRD01.PROD.OUTLOOK.COM.

Reply via email to