Because it is not a public method and nobody added the automethod to the
class to make sure it is included. That is my guess. Should be simple to
fix.
Best,
Travis
On Friday, September 27, 2019 at 8:42:43 PM UTC+10, Salvatore Stella wrote:
>
> Indeed it seems to be documented. Why is this not
Indeed it seems to be documented. Why is this not in the online
documentation?
S.
* Travis Scrimshaw [2019-09-26 17:59:38]:
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 a
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
> 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,
>
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
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
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__
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).__
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
Although it almost sounds like you should be doing the NewFoo preparsing
inside NewFoo.__classcall__ (or NewFoo.__classcall_private__), which then
should get passed up and handled by OldFoo.__classcall__. You might need
some extra *args or **kwds to the __init__ and/or __classcall__ to handle
t
Make OldFoo.__classcall_private__, then it is not inherited.
Best,
Travis
On Thursday, September 26, 2019 at 8:22:23 AM UTC+10, Salvatore Stella
wrote:
>
> Dear All,
> I would like to make a new class inheriting from a class based on
> UniqueRepresentation. My goal, among other things, is to
11 matches
Mail list logo