#10113: Calling seed() incorrectly causes Sage to crash with SIGSEGV 
(Segmentation
Fault)
------------------------------+---------------------------------------------
       Reporter:  drkirkby    |         Owner:  jason       
           Type:  defect      |        Status:  needs_review
       Priority:  major       |     Milestone:  sage-5.0    
      Component:  misc        |    Resolution:              
       Keywords:              |   Work issues:              
Report Upstream:  N/A         |     Reviewers:              
        Authors:  Simon King  |     Merged in:              
   Dependencies:              |      Stopgaps:              
------------------------------+---------------------------------------------

Comment (by SimonKing):

 Replying to [comment:9 cremona]:
 > which are similar in so far as they are reporting invalid input to a
 constructor.

 These examples are totally different, actually. In your example, the
 functions or methods are called, and then ''inside the function/method''
 the arguments are checked and an error is raised. In my example, Python
 tests whether the number of arguments is correct, which is not the case,
 and thus the error is raised ''before the method is called''.

 More differences:

 When you do `EllipticCurve([1])` you are calling a function
 {{{
 sage: type(EllipticCurve)
 <type 'function'>
 }}}
 and the function accepts anything between 1 and 3 arguments. Compare:
 {{{
 sage: EllipticCurve(1,2,3,4)
 Traceback (most recent call last)
 ...
 TypeError: EllipticCurve() takes at most 3 arguments (4 given)
 }}}

 When you call `ZZ(x)`, then you are calling the `__call__` method of `ZZ`,
 which accepts any number of arguments:
 {{{
 sage: from sage.misc.sageinspect import sage_getargspec
 sage: sage_getargspec(ZZ)
 ArgSpec(args=['self', 'x', '*args', '**kwds'], varargs=None,
 keywords=None, defaults=(0,))
 }}}

 However, in my example, a class is called. So, that would be something
 like
 {{{
 sage: ZZ.__class__(x)
 Traceback (most recent call last)
 ...
 TypeError: __init__() takes exactly 0 positional arguments (1 given)
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10113#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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-trac?hl=en.

Reply via email to