On Mon, Mar 10, 2014 at 04:35:25AM -0700, Volker Braun wrote: > IMHO the contained-class makes it clear what the base category is, but not > what the axiom is. For example: > class Cs(Category): > class Finite(CategoryWithAxiom): > pass > class Ds(Category): > class Endlich(CategoryWithAxiom): > pass > Now Cs.Finite implements an axiom, but Ds.Endlich does not (since you > haven't added the "Endlich" string to a global list somewhere).
No. What makes Endlich an axiom (or not) is that some super category has defined it (or not) [1]. As an analogy, when an abstract class C declares a method foo, and you implement this method in some subclass D, you don't write explicitly in D.foo that you override the method foo declared in C. If you need that information, you either use the semantic (here the math), or you walk the hierarchy. Of course, since the hierarchy is built dynamically here, you need to walk the hierarchy dynamically; introspection does that nicely for you (yes, unless Sage does not start at all; but in that case we are speaking of the very basic axioms and you can still use the math). Cheers, Nicolas [1] The fact that Sage needs a list of the names of all the axioms being defined is an implementation detail. Recall that it is used mostly for printing purposes (and allowing for syntactical sugar in some spots). We could get rid of it without changing the syntax of how axioms are defined and implemented. -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- 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 sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.