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 Aaron Hall
Recipients Aaron Hall, JJeffries, eric.araujo, ezio.melotti, pconnell, rhettinger
Date 2018-05-29.01:18:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527556698.36.0.682650639539.issue12154@psf.upfronthosting.co.za>
In-reply-to
Content
Should pydoc treat a partial object like a function?

Should a partial be an instance of a function?

Should we be able to add all the nice things that functions have to it?

If we want that, should we simply instantiate a function the normal way, with a new function definition? That is, instead of this:

>>> from functools import partial
>>> basetwo = partial(int, base=2)
>>> basetwo.__doc__ = 'convert base 2 string to int'

do this:

def basetwo(string:str) -> int:
    'convert base 2 string to int'
    return int(string, base=2)

Otherwise, either the partial definition or pydoc needs some work.

(Cheers and bump!)
History
Date User Action Args
2018-05-29 01:18:18Aaron Hallsetrecipients: + Aaron Hall, rhettinger, ezio.melotti, eric.araujo, JJeffries, pconnell
2018-05-29 01:18:18Aaron Hallsetmessageid: <1527556698.36.0.682650639539.issue12154@psf.upfronthosting.co.za>
2018-05-29 01:18:18Aaron Halllinkissue12154 messages
2018-05-29 01:18:18Aaron Hallcreate