On 19 Nov, 18:26, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> On Nov 19, 2008, at 10:18 AM, John H Palmieri wrote:
>
>
>
>
>
> > The documentation for the nth_root method for finite fields (repeated
> > in each of the files sage/structure/element.pyx, sage/rings/
> > finite_field_element.py, and sage/rings/finite_field_givaro.pyx) says
> > this:
>
> >         INPUT:
> >             n -- integer >= 1 (must fit in C int type)
> >             extend -- bool (default: True); if True, return a square
> >                  root in an extension ring, if necessary. Otherwise,
> >                  raise a ValueError if the square is not in the base
> >                  ring.
> >             all -- bool (default: False); if True, return all square
> >                  roots of self, instead of just one.
>
> >         OUTPUT:
> >            If self has an nth root, returns one (if all == False) or a
> > list of
> >            all of them (if all == True).  Otherwise, raises a
> > ValueError (if
> >            extend = False) or a NotImplementedError (if extend =
> > True).
>
> > The entirety of the code dealing with 'extend' is this:
>
> >         if extend:
> >             raise NotImplementedError
>
> > Should the 'extend' option be removed altogether, or should it be left
> > in with a big warning saying that it's not implemented?  (Or is
> > someone out there willing to implement it?)
>
> > (The same goes for the square_root method in finite_field_element.py.
> > The code for the sqrt method in finite_field_givaro.pyx is similar,
> > but the extend option, while present, isn't documented.)
>
> > I can open up a ticket for this, but it would be nice to have a
> > suggestion about which direction to go in the short term -- remove the
> > option or document the fact that it's not implemented -- to go on the
> > ticket.
>
> I think it's better to have the not implemented error. The signature  
> of this function is modeled after the square root,

So is the docstring, rather too closely!

 and it is handy to  
> be able to rely on it being consistent across all types. For example,  
> if I were writing the nth root method of a power series, I might want  
> to take the nth root of the constant coefficient, and could just pass  
> it the extend option that I got. Removing this option means I'd have  
> to check whether or not the extend option were valid, or get a (less  
> clear) type error when running the code.
>
> - Robert
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to