On 2015-08-29 16:19, Simon King wrote:
Hi Daniel,
On 2015-08-29, Daniel Krenn wrote:
Ok, thanks. I will use _is_category_initialized()
Just to be clear: Whether you should take type(self).__base__ or
type(self) *additionally* depends on whether you have an extension
type. _is_category_initia
Hi Daniel,
On 2015-08-29, Daniel Krenn wrote:
> Ok, thanks. I will use _is_category_initialized()
Just to be clear: Whether you should take type(self).__base__ or
type(self) *additionally* depends on whether you have an extension
type. _is_category_initialized() is not enough.
Best regards,
Sim
On 2015-08-29 15:15, Simon King wrote:
On 2015-08-29, Daniel Krenn wrote:
Let self be the parent in question, and assume that the underlying class
is a Python class. Then, you can test by self._is_category_initialized()
whether or not the category framework is actually used by self. If it is,
th
Hi Daniel,
On 2015-08-29, Daniel Krenn wrote:
> I thought about something similar, but this does not solve my problem,
> that I have a couple if classes derived from C, which all should use the
> same methodand, ideally, I don't want to override each of these to
> take care of the correct
On 2015-08-29 12:09, Eric Gourgoulhon wrote:
I would endow the parent class C with a method new_instance(), as in the
following example:
Thanks.
sage:classC(Parent,UniqueRepresentation):
:def__init__(self,data,category=Sets()):
:Parent.__init__(self,category=category)
:self._data
Hi,
I would endow the parent class C with a method new_instance(), as in the
following example:
sage: class C(Parent, UniqueRepresentation):
: def __init__(self, data, category=Sets()):
: Parent.__init__(self, category=category)
: self._data = data
: def n