Re: [sage-devel] Re: UniqueRepresentation inheritance and __classcall__

2019-09-26 Thread Travis Scrimshaw
There is also an example of this inheritance and discussion in one of the sage.structure.unique_representation examples. Best, Travis On Friday, September 27, 2019 at 10:57:52 AM UTC+10, Travis Scrimshaw wrote: > > > The prototype does, now I have to implement the real thing. >>> >>> Is there

Re: [sage-devel] Re: UniqueRepresentation inheritance and __classcall__

2019-09-26 Thread Travis Scrimshaw
> The prototype does, now I have to implement the real thing. >> >> Is there any way to add this info to the documentation? It took me a lot >> of >> trial and error to figure out how to do what I wanted. >> S. >> >> Definitely. The topical place would be in sage.misc.classcall_metaclass, >

Re: [sage-devel] Re: UniqueRepresentation inheritance and __classcall__

2019-09-26 Thread Nils Bruin
On Thursday, September 26, 2019 at 3:14:07 PM UTC-7, Salvatore Stella wrote: > > The prototype does, now I have to implement the real thing. > > Is there any way to add this info to the documentation? It took me a lot > of > trial and error to figure out how to do what I wanted. > S. > > Defin

Re: [sage-devel] Re: UniqueRepresentation inheritance and __classcall__

2019-09-26 Thread VulK
The prototype does, now I have to implement the real thing. Is there any way to add this info to the documentation? It took me a lot of trial and error to figure out how to do what I wanted. S. * Travis Scrimshaw [2019-09-26 15:11:07]: So it works now, correct? Best, Travis On Friday, S

Re: [sage-devel] Re: UniqueRepresentation inheritance and __classcall__

2019-09-26 Thread Travis Scrimshaw
So it works now, correct? Best, Travis On Friday, September 27, 2019 at 12:42:23 AM UTC+10, Salvatore Stella wrote: > > Oops, I think that I figured out where the mistake was. Here is the > correct > code: > > class OldFoo(UniqueRepresentation): > > @staticmethod > def __classcall__

Re: [sage-devel] Re: UniqueRepresentation inheritance and __classcall__

2019-09-26 Thread VulK
Oops, I think that I figured out where the mistake was. Here is the correct code: class OldFoo(UniqueRepresentation): @staticmethod def __classcall__(self, data, **kwargs): hashable_data = tuple(data) kwargs['some_default_option'] = 'bar' return super(OldFoo, self).__

[sage-devel] SageMath users in the UK?

2019-09-26 Thread Fredrik Strömberg
Hi all, if you are a SageMath developer or user and based at a university or institution in the UK we are interested in hearing from you. Especially if you are interested in joining a group of us trying to get EPSRC funding for Sage-related activities. Together with Chris Wutrich and some oth

Re: [sage-devel] Re: UniqueRepresentation inheritance and __classcall__

2019-09-26 Thread VulK
Thank you Travis for your reply. Here is an attempt at implementing your suggestion that does not work: it looks like OldFoo.__classcall__ is skipped and OldFoo.__init__ is run directly instead. This is not what I want: I would like the preparsing in OldFoo to still be performed after the prepar