On Sunday, September 20, 2015, Volker Braun <vbraun.n...@gmail.com> wrote:

> Why change the default? Global state is always a liability; Just don't do
> it.
>

+1. I was about to post the same.    Explicit is better than implicit.


> Make the field a parameter to your code:
>
> def frobnicate(x,y, field=None)
>     if field is None:
>         from sage.structure.element import get_coercion_model
>         field = get_coercion_model().common_parent(x, y)
>     x, y = field(x), field(y)
>     ...
>
> frobnicate(1, 2, field=RealField(100))
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','sage-devel%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to sage-devel@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','sage-devel@googlegroups.com');>.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Sent from my massive iPhone 6 plus.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to