Le 10/03/15 09:46, Joachim Durchholz a écrit :
ManagedProperties is declared like this:

class ManagedProperties(with_metaclass(BasicMeta, BasicMeta)):
     ...

I.e. ManagedProperties has BasicMeta both as its metaclass and as its
superclass (so it is a metaclass itself).

What's the purpose of this construction?
I suspect we should separate the metaclass functionality into a separate
class (or class hierarchy), but it's quite possible that I'm overlooking
something.

(Once I know the purpose, I can analyze how it applies to subclasses
which have a similarly dual superclass-metaclass nature.)

The PR that created this was https://github.com/sympy/sympy/pull/328

There wasn't any discussion about having BasicMeta as a metaclass of ManagedProperties (called WithAssumptions then), but, IIRC, the reason was to ensure correct registration of ManagedProperties and its subclasses. Looking back, I'm not sure that it was really needed. My suggestion: try removing the metaclass relationship and see if anything breaks!

--
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/54FF8387.8050507%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to