Like others, I think consistent naming is a good idea, except when it is
not(...), and the specific details are harder to get right. Thanks to
those who try to improve the Sage API.
One nice advantage of names such as facets_{num,number,count} is
discoverability via tab-completion, especially if the user already knows
the facets() method exists. It happens that IPython supports [1]
glob-style matches such as obj.*abc*?, to find all attributes containing
"abc", but I suppose most people do not use this feature, so it will be
harder to know that n_facets() exists. On the other hand, in Sage,
trying to complete obj.is_* is a good way to start inspecting an object,
so maybe obj.n_* will be a good starting point for "simple" enumerations.
A partial remedy is adding a SEEALSO block in the factes() docstring
referencing n_factes(), assuming users read the docs. If n_facets() is
more efficient than len(facets()), e.g., in time or memory, then it also
merits a mention in the same place.
Regards,
TB
[1]
https://ipython.readthedocs.io/en/stable/interactive/python-ipython-diff.html
> --
> 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
sage-devel+...@googlegroups.com <mailto:
sage-
>
devel+un...@googlegroups.com>.
> To view this discussion visit
https://groups.google.com/d/msgid/sage-
> devel/804af5fd-c14e-4670-ad1c-e7529bd516c1n%
40googlegroups.com <https://
>
groups.google.com/d/msgid/sage-devel/804af5fd-c14e-4670-ad1c-
> e7529bd516c1n%
40googlegroups.com?utm_medium=email&utm_source=footer>.