4 ms·
what, not using metaclasses in that case caused more "issues" than would of been caused by using metaclasses multiple global values to track state, since can't
by RubyPinch 10y ago
what, not using metaclasses in that case caused more "issues" than would of been caused by using metaclasses
multiple global values to track state, since can't bind the state to the class' creation, since the conversion to the final form of the class happened after its creation, vs being able to bind the state to the class' creation, since the conversion happens as the class is created
- carapace 10y agoKnowing nothing more about this codebase than the above, I would fire everyone and make the CEO's nephew write it. It could hardly turn out worse and it would be a lot cheaper. (I'm joking, but only barely.)
- RubyPinch 10y agoThe reduced usecase (story?) is the following The customer requests the following @? class somename (?): an_attr_a = ADescriptor(somestuff) an_attr_1 = ADescriptor(somestuff) an_attr_a1 = ADescriptor(somestuff) One of their expectations is that the attributes have their definition order stored somewhere. You may either use the decorator method, or the metaclass method