[Python-Dev] readonly doc (original) (raw)

Guido van Rossum guido at python.org
Thu Oct 22 22:59:17 CEST 2009


On Thu, Oct 22, 2009 at 1:49 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

Brett Cannon <brett python.org> writes:

I honestly don't follow that sentence. But doc is special because of its use; documenting how to use of an object. In this case when you call something like help() on an instance of an object it skips the instance's value for doc and goes straight to the defining class and stops there as you don't care how a subclass says to use itself as that is not what you are working with. I don't really understand how this explains the read-only doc. I am talking about modifying doc on a class, not on an instance. (sure, a new-style class is also an instance of type, but still...)

Antoine, it's not clear from the questions you're asking whether you've read the code in typobject.c that implements doc or not.

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list