Thanks for your quick answers. Coming from Mathematica, I was expecting to
add lists as vectors, multiply real numbers by lists, etc, without
sub-classing or using another types (such as vectors in sage)

Do you advise me to add things to the preparser to have this behaviour or
not? If so, how can I do it?


On Sat, Jul 11, 2009 at 4:00 PM, Marshall Hampton <hampto...@gmail.com>wrote:

>
>
> You could also make your own sub-class like:
>
> class mylist(list):
>    def sum(self):
>        return sum(self)
>
> but then you would have to explicitly cast things to this class.
>
> -M. Hampton
>
> On Jul 11, 11:47 am, Harald Schilly <harald.schi...@gmail.com> wrote:
> > the int->integer replacement is done by a preparser. if you turn it
> > off, sage is "pure" python only.
> > the list is a pure python object and i don't think it makes sense to
> > change anything. I recommend you to use a "vector",
> > sage: vector(RDF, [1,2,3])
> >
> > h
> >
> > On Jul 11, 6:41 pm, Carlos Cordoba <ccordob...@gmail.com> wrote:
> >
> > > Hi,
> >
> > > I noticed that the int python type is replaced by the Integer type in
> > > Sage. I'm wondering if I could do the same with the list type, so I
> > > can add a functionality I need to it.
> >
> > > Could you tell how I can do it?
> >
> > > Thanks,
> > > Carlos
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to