Python metaclasses
11–20 of 30 posts
Re: Python metaclasses
#12This is an interesting and fairly well explained post, but a little light on real world examples. Can anyone maybe suggest a few examples of where this could be used (or is used already?)
Re: Python metaclasses
#13Re: Python metaclasses
#14Tangential question, is there anything similar to Moose (Perl) in the Python world?
Re: Python metaclasses
#15This is an interesting and fairly well explained post, but a little light on real world examples. Can anyone maybe suggest a few examples of where this could be used (or is used already?)
Re: Python metaclasses
#16Tangential question, is there anything similar to Moose (Perl) in the Python world?
What's moose?
TL;DR: Moose is an awesome OO framework for Perl.
Re: Python metaclasses
#17There are many ways to enforce a constraint from dervied classes to base classes.
Metaclasses are the only* way to enforce a constraint from a base class to a derived class.
(* there's actually another way, but don't do it.)
Re: Python metaclasses
#18Re: Python metaclasses
#19Great tool, but not to be put in the wrong hands. The folks at Django got it right. We used it for unifying, simplifying and ensuring consistency of deeply nested configuration data entered using different means. However, in environment with less experience, I have seen "Akira-final-scene-tetsuo" monsters come to life with this. Another loosely related suggestion: if we could stay away from singleton as examples, I t…
I wouldn't quite say this - I wouldn't want to discourage someone who's going to learn them to go ahead, but I'd just say "Only use them when you really need to use them and if you're going to use them make sure you really understand them".
Re: Python metaclasses
#20Tangential question, is there anything similar to Moose (Perl) in the Python world?
But I do a fair amount of Python, and a 20 minute cruise through the Moose docs leads me to believe that the most similar thing to Moose in the Python world is, well, Python.