On Sat, Nov 18, 2017 at 2:38 PM, Python <pyt...@bladeshadow.org> wrote: > On Sat, Nov 18, 2017 at 02:19:25PM +1100, Chris Angelico wrote: >> On Sat, Nov 18, 2017 at 2:12 PM, Python <pyt...@bladeshadow.org> wrote: >> > On Sat, Nov 18, 2017 at 10:47:55AM +1100, Chris Angelico wrote: >> >> On Sat, Nov 18, 2017 at 10:34 AM, Python <pyt...@bladeshadow.org> wrote: >> >> > On Sat, Nov 18, 2017 at 09:50:29AM +1100, Chris Angelico wrote: >> >> >> Perhaps what we want is not so much "attach docstrings to floats" but >> >> >> "get documentation for a module attribute, not for the object referred >> >> >> to". >> >> > >> >> > The reason this can't really work is that members are just variables >> >> > with arbitrary values. It does not make sense for them to have doc >> >> > strings. >> >> >> >> Did you read my post? >> > >> > Yes! Did you read mine? I tried to explain to you that what you're >> > suggesting doesn't really fit Python's paradigm: Doc strings describe >> > their owner class, not individual instances--the class' doc string is >> > where the description of your class (or module--same thing) attributes >> > should go. >> >> I gave a detailed example of something that was NOT a docstring. That >> was, in fact, the whole point of my post. > > Ah... Sorry, I didn't find that to be clear from your post, even after > rereading it... I took it to mean that *conceptually* it was different > from a doc string, but still actually using the doc string via some > magic, the description of which I honestly found kind of vague and > hand-wavey, not so much detailed. And TBH I still do, even now that I > have a better idea what you're talking about. ¯\_(ツ)_/¯ Apologies > for my confusion.
Ah. Yeah, the point was that the comment *was actually* the documentation. That's why that idea is unlikely to be practical - it involves reading the source. But it IS possible, without any compiler help. Apology accepted :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list