Message317971
| 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!) |
|