Le dimanche 16 octobre 2011 à 23:58 +0200, Florent Hivert a écrit :
> Also I can't reproduce you behavior:
> 
> ----------------------------------------------------------------------
> | Sage Version 4.7.1, Release Date: 2011-08-11                       |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
> sage: class MyParent(Parent):
> ....:     class Element(ClonableIntArray):
> ....:         def check(self):
> ....:             pass
> ....:         
> sage: B = MyParent()
> sage: B([0,0,0])
> ---------------------------------------------------------------------------
> NotImplementedError                       Traceback (most recent call last)
> 
> /home/florent/<ipython console> in <module>()
> 
> /home/florent/src/Sage/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
>  in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:6915)()
> 
> NotImplementedError: 

Hello

I find the error well placed here. I am very ok with a Not Implemented
Error instead of problem of positional arguments.

I try to reproduce the code to get the NotImplementedError. And it was
very difficult, because, every times, I use the element_class to be
convinced that the piece of code is working well. But using it probably
modify something somewhere, look:

sage: class Myparent(Parent):
....:     class Element(ClonableIntArray):
....:         def check(self):
....:             pass
....:         
sage: B = Myparent()
sage: B([0,0,0,0])      # First call
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call
last)
...
NotImplementedError: 
sage: B.element_class(B, [0,0,0,0])
[0, 0, 0, 0]
sage: B([0,0,0,0])      # Call after using element_class
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)
...
TypeError: __init__() takes at least 2 positional arguments (1 given)

I don't think that so much disturbing, but when you meet only the second
error (because of any reason....) without seeing the first one, I was
thinking the _element_constructor_from_element_class method of set_cat
was incompatible with the __init__ of ClonableIntArray. 

Anyway, I didn't find any obstruction of the use of ClonableIntArray.

Sorry for the noise.

Cheers,
Nicolas.



-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to