On Sunday, June 7, 2020 at 5:17:24 PM UTC-4, Andrey Novoseltsev wrote:
>
> I've fiddled a bit with automatic controls for different types:
>
> https://github.com/sagemath/sagecell/commit/6612cabb355699638b033567fc1cb1cdf7a7c43a
>
> I dislike the distinction in behaviour between tuples/lists/generators, 
> especially when it is dependent on length, but tried to keep the logic that 
> presumably used to work at some point. 
>

Thanks.  Yeah, maybe in retrospect things should have had to be explicit 
selectors or ranges, but it is SO convenient ...
 

> Namely:
> - range used to return a list, so I treat it as a list
> - there was treatment for GeneratorType and 1..10 now returns generator 
> (which is a different thing, not sure if it was the case before), so I 
> treat it the same way as Generator type.
>

The fact that [1..10] and (1..10) return different things is good, in my 
opinion (based on previous behavior).
 

> Check the behaviour on this code:
>
> @interact
> def f(n=range(2,7)):
>     @interact
>     def g(a=range(n), b=list(range(n)), c=(0..n), d=tuple(range(n))):
>         print(a, b, c, d)
>


I still love that we have nested interacts; I've used them far too little! 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-cell+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-cell/815bfbb5-8bfa-4ca4-ae0d-47ab875e1f3eo%40googlegroups.com.

Reply via email to