Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-20 Thread Raymond Hettinger
> On Mar 20, 2019, at 3:59 PM, Ethan Furman wrote: > > Hmm. Said somewhat less snarkily, is there a more general solution to the > problem of absent docstrings or do we have to attack this problem > piece-by-piece? I think this is the last piece. The pydoc help() utility already knows how

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-20 Thread Raymond Hettinger
> On Mar 20, 2019, at 3:47 PM, Ivan Pozdeev via Python-Dev > wrote: > >> NormalDist.mu.__doc__ = 'Arithmetic mean' >> NormalDist.sigma.__doc__ = 'Standard deviation' > > IMO this is another manifestation of the problem that things in the class > definition have no access to the class

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-20 Thread Ethan Furman
On 03/20/2019 03:24 PM, Ethan Furman wrote: On 03/19/2019 11:55 AM, Raymond Hettinger wrote: There's another way I would like to propose. The __slots__ definition already works with any iterable including a dictionary (the dict values are ignored), so we could use the values for the

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-20 Thread Raymond Hettinger
> On Mar 20, 2019, at 3:30 PM, Gregory P. Smith wrote: > > I like the idea of documenting attributes, but we shouldn't force the user to > use __slots__ as that has significant side effects and is rarely something > people should bother to use. Member objects are like property objects in

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-20 Thread Ivan Pozdeev via Python-Dev
On 19.03.2019 21:55, Raymond Hettinger wrote: I'm working on ways to make improve help() by giving docstrings to member objects. One way to do it is to wait until after the class definition and then make individual, direct assignments to __doc__ attributes.This way widely the separates

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-20 Thread Gregory P. Smith
(answers above and below the quoting) I like the idea of documenting attributes, but we shouldn't force the user to use __slots__ as that has significant side effects and is rarely something people should bother to use. There are multiple types of attributes. class and instance. but regardless

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-20 Thread Ethan Furman
On 03/19/2019 11:55 AM, Raymond Hettinger wrote: I'm working on ways to make improve help() by giving docstrings to member objects. Cool! There's another way I would like to propose. The __slots__ definition already works with any iterable including a dictionary (the dict values are

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-20 Thread Serhiy Storchaka
19.03.19 20:55, Raymond Hettinger пише: I'm working on ways to make improve help() by giving docstrings to member objects. One way to do it is to wait until after the class definition and then make individual, direct assignments to __doc__ attributes.This way widely the separates docstrings

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-19 Thread Raymond Hettinger
> On Mar 19, 2019, at 1:52 PM, MRAB wrote: > > Thinking ahead, could there ever be anything else that you might want also to > attach to member objects? Our experience with property object suggests that once docstrings are supported, there don't seem to be any other needs. But then, you

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-19 Thread MRAB
On 2019-03-19 18:55, Raymond Hettinger wrote: I'm working on ways to make improve help() by giving docstrings to member objects. One way to do it is to wait until after the class definition and then make individual, direct assignments to __doc__ attributes.This way widely the separates

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-19 Thread Abdur-Rahmaan Janhangeer
I have the impression that the line between variables and docs is a tidbit too much blurred. Yours, Abdur-Rahmaan Janhangeer Mauritius ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

[Python-Dev] Best way to specify docstrings for member objects

2019-03-19 Thread Raymond Hettinger
I'm working on ways to make improve help() by giving docstrings to member objects. One way to do it is to wait until after the class definition and then make individual, direct assignments to __doc__ attributes.This way widely the separates docstrings from their initial __slots__ definition.