Re: [sage-devel] Should the "Element = ..." trick require categories?

2017-12-11 Thread Jeroen Demeyer
On 2017-12-10 22:29, Nicolas M. Thiery wrote: As far as I remember, it's stipulated that any Parent should be in Sets. I don't think that this is stipulated somewhere. I also feel that this shouldn't be a hard requirement. I think that the low-level basic stuff (I consider creating elements a

Re: [sage-devel] Should the "Element = ..." trick require categories?

2017-12-10 Thread Travis Scrimshaw
There are two things going on that I had thought were coupled together, but are actually not: 1 - The construction of the dynamic class element_class, which is currently done by Parent.__make_element_class__, which in turn indirectly calls Category._make_named_class via @lazy_attribute Category

Re: [sage-devel] Should the "Element = ..." trick require categories?

2017-12-10 Thread Nicolas M. Thiery
Hi Jeroen, On Sat, Dec 09, 2017 at 09:44:54AM +0100, Jeroen Demeyer wrote: > The "modern" way to define a Parent class is as follows: > > class MyParent(Parent): > Element = MyElement > def __init__(self): > Parent.__init__(self, category=MyCategory()) > > One thing which

[sage-devel] Should the "Element = ..." trick require categories?

2017-12-09 Thread Jeroen Demeyer
The "modern" way to define a Parent class is as follows: class MyParent(Parent): Element = MyElement def __init__(self): Parent.__init__(self, category=MyCategory()) One thing which surprises me is that the code to have the "Element = MyElement" trick work is implemented in the