Barry Warsaw wrote:
> Certainly "foo.get_something()" and
> "foo.set_something(thing)" are much better spelled "foo.something" and
> "foo.something = thing".

If you already have a get/set pair, that definitely
makes sense. If hash() had been spelled get_hash()
it might have made sense there too.

But it wasn't, and for a reason, I think -- it
implies performing a substantial computation
rather than just retrieving a pre-existing value
from somewhere. Even if it's cached, that's still
true, since the computation needs to be done the
first time it's called.

Another consideration is that if something is a
method, you can get a bound method from it. With
a property that's much harder, and may be impossible
depending on how the property is implemented.

--
Greg
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to