homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients r.david.murray, skip.montanaro
Date 2017年04月21日.23:49:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492818595.61.0.832428319532.issue30129@psf.upfronthosting.co.za>
In-reply-to
Content
Again, my apologies for the crappy initial bug report. Hopefully this comment and the two files I just attached demonstrate what I am getting at.
I just uploaded a stupid little example, partial3.py. Stupid, but still, it demonstrates part of how I think docstrings on these partial methods could be improved. If you run it (I'm using Python 3.6.1), note that the doc strings for the sum method (instance and class), look wrong:
Child.sum doc: None
c.sum doc: partial(func, *args, **keywords) - new function with partial application
 of the given arguments and keywords.
The file, ft.diff, includes a one-line patch to partialmethod.__get__ which corrects the docstring for the instance of the Child class:
Child.sum doc: None
c.sum doc: sum doc
I haven't looked to see where the docstring of Child.sum could be set, but I believe it should be fairly straightforward for someone more familiar with this code. Also, the patch doesn't improve the output of pydoc:
partial3.Child = class Child(builtins.object)
 | Methods defined here:
 | 
 | diff(self, arg1, arg2)
 | diff doc
 | 
 | sum = _method(self, arg2)
 | 
 | ----------------------------------------------------------------------
 | Data descriptors defined here:
 | 
 | __dict__
 | dictionary for instance variables (if defined)
 | 
 | __weakref__
 | list of weak references to the object (if defined)
History
Date User Action Args
2017年04月21日 23:49:55skip.montanarosetrecipients: + skip.montanaro, r.david.murray
2017年04月21日 23:49:55skip.montanarosetmessageid: <1492818595.61.0.832428319532.issue30129@psf.upfronthosting.co.za>
2017年04月21日 23:49:55skip.montanarolinkissue30129 messages
2017年04月21日 23:49:55skip.montanarocreate

AltStyle によって変換されたページ (->オリジナル) /