[issue20439] inspect.Signature: Add Signature.format method to match formatargspec functionality

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20439] inspect.Signature: Add Signature.format method to match formatargspec functionality

2014-01-29 Thread Yury Selivanov

New submission from Yury Selivanov:

The ability to fine-tune formatting of Signature (currently Signature.__str__) 
might be useful for pydoc and idle.

--
assignee: yselivanov
messages: 209660
nosy: brett.cannon, larry, ncoghlan, terry.reedy, yselivanov
priority: normal
severity: normal
status: open
title: inspect.Signature: Add Signature.format method to match formatargspec 
functionality
type: enhancement
versions: Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20439
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20439] inspect.Signature: Add Signature.format method to match formatargspec functionality

2014-01-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For an api, given that we have
formatargvalue(*getargvalues, ...)
formatargspec(*getfullargspec, ...)
we might add
formatsignature(signature, ...)
with the default being the same as str(signature).

I checked the first 80 hits at
http://code.ohloh.net/search?s=formatargspec%28p=7pp=0fl=Pythonmp=1ml=1me=1md=1ff=1filterChecked=true
(which I found with 'search code' on Google) and 10-15% used one of the 
extended args. Another at least 5% used [1:=1] to strip of '(' and ')', so any 
new function might have 'parens=True' option.

Idle uses the default formatargspec, like almost all other uses, and I presume 
str(sig) is the same except for where formatargspec is arguably wrong (bound 
methods).  A calltip is a tip, not a doc, so I am most concerned that parameter 
names not be misleading, as in pattern.match(string) having the parameter 
misnamed 'pattern' in the C code and I presume, in .signature (absent being 
fixed). But that is not .signature's fault.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20439
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com