Geoff Bache <geoff.ba...@gmail.com> writes: > I'm wondering if there is any way to customize class attribute access > on classic classes?
Why do that? What is it you're hoping to achieve, and why limit it to classic classes only? > So this works: > > class Meta(type): > def __getattr__(cls, name): > return "Customized " + name > > class A: > __metaclass__ = Meta > > print A.blah > > but it turns A into a new-style class. Yes, A is a new-style class *because* it inherits from ‘type’ <URL:http://docs.python.org/reference/datamodel.html#new-style-and-classic-classes>. Why does that not meet your needs? -- \ Contentsofsignaturemaysettleduringshipping. | `\ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list