Hey Viviane,
   I suspect what is going on is by constructing an instance of 
GradedAlgebras, various magic of the category framework is being 
initialized (and is cached on the class), and so when it's used after that, 
it then doesn't have to find a particular path for the printing magic and 
thus it works...

Although I think inheriting from a category like (and on the command line 
than in a static file) that is an abuse of the category framework, or at 
least wasn't designed so much for that.

Best,
Travis


On Thursday, June 11, 2015 at 8:52:19 AM UTC-7, Viviane Pons wrote:
>
> Hi everyone,
>
> I'm trying to inherit from GradedAlgebras, but for some reason I hit a 
> "maximum recursion depth" exception.
>
> More precisely, this does not work:
>
> sage: class T(GradedAlgebras):
>     pass
> ....: 
> sage: T(QQ)
>
> whereas, this does:
>
> sage: GradedAlgebras(QQ)
> Category of graded algebras over Rational Field
> sage: class T(GradedAlgebras):
>     pass
> ....: 
> sage: T(QQ)
> Category of graded algebras over Rational Field
>
> I'd like to understand why and I would like to understand what to do to 
> make it work without creating a useless instance of GradedAlgebras first. 
>
> Best
>
> Viviane
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to