Re: [sage-devel] UniqueRepresentation in FormalSums

2016-01-13 Thread Daniel Krenn
On 2016-01-13 21:15, 'Martin R' via sage-devel wrote: > I'm trying to understand inheritance. In formal_sum I find the > following code: > > class FormalSums(UniqueRepresentation, Module): > > Element = FormalSum > > def _element_constructor_(self, x, check=True, reduce=True): > >

Re: [sage-devel] UniqueRepresentation in FormalSums

2016-01-13 Thread 'Martin R' via sage-devel
> > To understand the difference between ‘is’ and ‘==‘ may require some > background in programming. > > Specifically, “a==b” evaluates to “True” if the objects ‘a’ and ‘b’ > “evaluate to the same *value*”, while “a is b” evaluates to “True” if the > objects ‘a’ and ‘b’ *are the same” (i.e.,

Re: [sage-devel] UniqueRepresentation in FormalSums

2016-01-13 Thread John H Palmieri
On Wednesday, January 13, 2016 at 1:03:15 PM UTC-8, Martin R wrote: > > > > Am Mittwoch, 13. Januar 2016 21:57:00 UTC+1 schrieb John H Palmieri: >> >> >> >> On Wednesday, January 13, 2016 at 12:43:25 PM UTC-8, Martin R wrote: >>> >>> To understand the difference between ‘is’ and ‘==‘ may require

Re: [sage-devel] UniqueRepresentation in FormalSums

2016-01-13 Thread John H Palmieri
On Wednesday, January 13, 2016 at 12:43:25 PM UTC-8, Martin R wrote: > > To understand the difference between ‘is’ and ‘==‘ may require some >> background in programming. >> >> Specifically, “a==b” evaluates to “True” if the objects ‘a’ and ‘b’ >> “evaluate to the same *value*”, while “a is b”

Re: [sage-devel] UniqueRepresentation in FormalSums

2016-01-13 Thread 'Martin R' via sage-devel
Am Mittwoch, 13. Januar 2016 21:57:00 UTC+1 schrieb John H Palmieri: > > > > On Wednesday, January 13, 2016 at 12:43:25 PM UTC-8, Martin R wrote: >> >> To understand the difference between ‘is’ and ‘==‘ may require some >>> background in programming. >>> >>> Specifically, “a==b” evaluates to

[sage-devel] UniqueRepresentation in FormalSums

2016-01-13 Thread 'Martin R' via sage-devel
Hi there! I'm trying to understand inheritance. In formal_sum I find the following code: class FormalSums(UniqueRepresentation, Module): Element = FormalSum def _element_constructor_(self, x, check=True, reduce=True): if isinstance(x, FormalSum): P = x.parent()

Re: [sage-devel] UniqueRepresentation in FormalSums

2016-01-13 Thread Justin C. Walker
On Jan 13, 2016, at 12:15 , 'Martin R' via sage-devel wrote: > Hi there! > > I'm trying to understand inheritance. In formal_sum I find the following > code: > > class FormalSums(UniqueRepresentation, Module): > > Element = FormalSum > > def