selector behavior difference , Combinations or Arrangements list
HI
I opened this question first then I deleted it after a while now I re-open it because finally I do not know if its a pb or not!. sorry for my versatile behavior
Ubuntu 18.04 , SageMath 9.0 notebook
why if I uncoment line 3 of the code below, I get TraitError: Invalid selection: value not found. but code is ok if line 3 commented
anIndexL=[1..5]
anCoupleIndexL=Arrangements(anIndexL,2).list()
#anCoupleIndexL=Combinations(anIndexL,2).list()
show(anCoupleIndexL)
@interact
def _( nbStepMax=slider(1,20,1,default=20),anCouple = selector(anCoupleIndexL,default=anCoupleIndexL[0])):
show(anCouple)
Arrangements return object parent is ๐ฐ๐๐๐๐๐๐๐๐๐๐๐ ๐๐ ๐๐๐ ๐๐๐[๐ท,๐ธ,๐น,๐บ,๐ป] ๐๐ ๐๐๐๐๐๐ ๐ธ
As Combinations return object is a simple list.
anIndexL=[1..5]
anCoupleIndexL0=Arrangements(anIndexL,2).list()
anCoupleIndexL1=Combinations(anIndexL,2).list()
anCoupleIndexStrL0=[]
print("test parent couple for anCoupleIndexL0")
for an in anCoupleIndexL0 :
anT=[]
for e in an :
show(e.parent())
show(an.parent())
anCoupleIndexStrL0.append(anT)
anCoupleIndexStrL1=[]
print("test parent couple for anCoupleIndexL1")
for an in anCoupleIndexL1 :
anT=[]
for e in an :
show(e.parent())
show(an.parent())
anCoupleIndexStrL1.append(anT)
strange if I not put default value, then the displayed choices are integers, not Integers couples. (if uncommented line 3)
finally I did a wobbly (horrible ! ;-) ) workaround: