Message317971
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!) |
|
Date |
User |
Action |
Args |
2018-05-29 01:18:18 | Aaron Hall | set | recipients:
+ Aaron Hall, rhettinger, ezio.melotti, eric.araujo, JJeffries, pconnell |
2018-05-29 01:18:18 | Aaron Hall | set | messageid: <1527556698.36.0.682650639539.issue12154@psf.upfronthosting.co.za> |
2018-05-29 01:18:18 | Aaron Hall | link | issue12154 messages |
2018-05-29 01:18:18 | Aaron Hall | create | |
|