[Python-Dev] Re: [PEP 224] Attribute Docstrings

Tony J Ibbs (Tibs) tony at lsl.co.uk
Tue Aug 29 05:17:21 EDT 2000


Hmm. I've finally had time to have a quick look at the PEP. I can't say I'm
too keen on the *appearance* in Python code of using string attributes in
this manner, but that's a matter for another debate[1].

Could I request that you add to the "Caveats" section a note along the
following lines:

	Documenting a value which has just been assigned
	a string may be slightly confusing to someone
	"speed reading" Python code, as:

		a = "fred"
		"Smith's forename"

	has a notably different effect than the (one
	character different)

		a = "fred"\
		"Smith's forename"

Obviously not a show-stopper, but I bet it will be a FAQ at some time...

(will we also get a tool to tell us when we've accidentally overwritten the
doc string for an attribute, class, whatever? I know I'm not going to have
time to write it...)

[1] OK - I think I'm going to find this makes Python code less compact to
read (I bet Eddy Welbourne will grumble, if he's still writing Python in his
new job). Somehow I want a delimiter in there somewhere. But that's
individual esthetics, and difficult to argue about, especially when so many
people whose opinion I respect are jumping up and down saying this is a good
idea.

Personally, I think this issue belongs really strongly with the issue about
optionally declaring values - after all, that is (in some sense) what one is
doing - one is trying to *describe* them. I would have felt happier if it
got folded in with that (and thus the types sig DOC thread). Or is this a
quick way to get strings attached to values so that one can get a Python2.n
which uses those strings to hold type info without having to change the
Python syntax? Stupid minds want to know...

Tibs

--
Tony J Ibbs (Tibs)      http://www.tibsnjoan.co.uk/
"Bounce with the bunny. Strut with the duck.
 Spin with the chickens now - CLUCK CLUCK CLUCK!"
BARNYARD DANCE! by Sandra Boynton
My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)





More information about the Python-list mailing list