Re: [Tutor] properties and subclasses

2005-04-27 Thread Kent Johnson
Max Noel wrote: Speaking of that, would you happen to know a good tutorial/introduction to metaclasses in Python? Here is an example that bills itself as "The Simplest Possible Metaclass": http://orbtech.com/blog/simplemetaclass The new Python Cookbook (the printed one) has a chapter on Descri

Re: [Tutor] properties and subclasses

2005-04-27 Thread Alan Gauld
> > Once you get used to them meta-classes are very useful. In fact I have > > never built an industrial size OO system yet that did not use meta > > classes somewhere in the design... > > Speaking of that, would you happen to know a good > tutorial/introduction to metaclasses in Python? Nope, bu

Re: [Tutor] properties and subclasses

2005-04-26 Thread Kent Johnson
Max Noel wrote: Speaking of that, would you happen to know a good tutorial/introduction to metaclasses in Python? You could try Guido's essay: http://www.python.org/2.2/descrintro.html#metaclasses Kent ___ Tutor maillist - Tutor@python.org http://m

Re: [Tutor] properties and subclasses

2005-04-26 Thread Max Noel
On Apr 26, 2005, at 22:01, Alan Gauld wrote: I had found the first thread you linked. I see what you mean about the cure -- my general belief is that *I* am unlikely to have problems for which meta-classes are really the best solution :-) Once you get used to them meta-classes are very useful. In

Re: [Tutor] properties and subclasses

2005-04-26 Thread Brian van den Broek
Alan Gauld said unto the world upon 2005-04-26 17:01: I had found the first thread you linked. I see what you mean about the cure -- my general belief is that *I* am unlikely to have problems for which meta-classes are really the best solution :-) Once you get used to them meta-classes are very u

Re: [Tutor] properties and subclasses

2005-04-26 Thread Alan Gauld
> I had found the first thread you linked. I see what you mean about the > cure -- my general belief is that *I* am unlikely to have problems > for which meta-classes are really the best solution :-) Once you get used to them meta-classes are very useful. In fact I have never built an industrial

Re: [Tutor] properties and subclasses

2005-04-26 Thread Brian van den Broek
Kent Johnson said unto the world upon 2005-04-26 06:24: Brian van den Broek wrote: Hi all, I'm trying to get a hang of properties. It isn't quite clear to me what is the best way to make properties differ in subclasses. Some code snips to show what I've tried: I can get what I want this way: class

Re: [Tutor] properties and subclasses

2005-04-26 Thread Kent Johnson
Brian van den Broek wrote: Hi all, I'm trying to get a hang of properties. It isn't quite clear to me what is the best way to make properties differ in subclasses. Some code snips to show what I've tried: I can get what I want this way: class A(object): ... def __init__(self): pass ... def

[Tutor] properties and subclasses

2005-04-25 Thread Brian van den Broek
Hi all, I'm trying to get a hang of properties. It isn't quite clear to me what is the best way to make properties differ in subclasses. Some code snips to show what I've tried: class A(object): ... def __init__(self): pass ... def prop_set(self): return "I was set by A's method" ... my