I\'m trying to write a Ruby class that works simila开发者_StackOverflow中文版rly to Rails AactiveRecord model in the way that attributes are handled:
I need to dynamically create class attributes from a DEFAULTS dictionary. defaults = { \'default_value1\':True,
inheriting a class attribute from a super class and later changing the value for the subclass works fine:
How exactly does Python evaluate class attributes?I\'ve stumbled across an interesting quirk (in Python 2.5.2) that I\'d like explained.