sage.misc.defaults.variable_names tuple vs list

34 views
Skip to first unread message

Reimundo Heluani

unread,
Jun 4, 2020, 2:56:55 PM6/4/20
to sage-...@googlegroups.com
The output of sage.misc.defaults.variable_names and latex_variable_names is of
type list if n=1 while type tuple if n>1. Is this really the intended
behaviour?

To concatenate another tuple/list to this output in a manner that is independent of n
requires an extra conversion.

Cheers,

R.


signature.asc

Nils Bruin

unread,
Jun 4, 2020, 3:43:54 PM6/4/20
to sage-devel
On Thursday, June 4, 2020 at 11:56:55 AM UTC-7, Reimundo Heluani wrote:
The output of sage.misc.defaults.variable_names and latex_variable_names is of
type list if n=1 while type tuple if n>1. Is this really the intended
behaviour?

I would find that hard to believe. My guess the author forgot that a 1-element-tuple in python is spelled "(name,)" and hence found a list easier to return. It's also a routine that doesn't have a docstring or doctests!

I'd think "tuple" is the more appropriate thing to return here.

Reimundo Heluani

unread,
Jun 4, 2020, 5:37:44 PM6/4/20
to sage-...@googlegroups.com
Thanks, I opened #29797

I don't think my patchbot can test it cause I switched to gcc 10.1 and I will
need to either change the Makefile or compile gcc as an SPKG.

R

>--
>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 [1]sage-devel+...@googlegroups.com.
>To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
>sage-devel/2c034fb7-764c-4aca-99ca-85a90d66e35bo%40googlegroups.com.
>
>References:
>
>[1] mailto:sage-devel+...@googlegroups.com
>[2] https://groups.google.com/d/msgid/sage-devel/2c034fb7-764c-4aca-99ca-85a90d66e35bo%40googlegroups.com?utm_medium=email&utm_source=footer

signature.asc
Reply all
Reply to author
Forward
0 new messages