ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> doc-sig
doc-sig
Re: [Doc-SIG] Proposal: don't nest optional brackets
by Ron Adam other posts by this author
Sep 26 2008 7:05AM messages near this date
Re: [Doc-SIG] Proposal: don't nest optional brackets | Re: [Doc-SIG] Proposal: don't nest optional brackets
Georg Brandl wrote:

>  My proposal: Since we already give a Python-like signature, why not give the
>  full signature for Python functions? That is, simply show default values for
>  arguments like
>  
>  warnings.filterwarnings(action, message="", category=Warning, module="",
>  lineno=0, append=0)
>  
>  That way, we also can get rid of awkward tons of parenthetical remarks like
>  in "If foo is None (which is the default)", and also get to add that information
>  in the first place where it was missing before.
>  
>  The argument defaults can be shown in a different typographical style if
>  desired. Parameters whose default isn't easily displayable can continue to use
>  the brackets.

I think that would be fine.  Maybe a separate section can be added on the 
topic of understanding function arguments that uses the nested bracketed 
forms to help users understand python signatures.

I was hoping at some point we might be able to generate the signatures and 
summary automatically from the source, and merge in the discussion and 
examples.  But currently generating signatures isn't possible for all 
functions.

BTW... Have you tried out the pydoc patch I submitted George?  I haven't 
got any feedback on it yet, so it's just sitting there gathering dust.

          http://bugs.python.org/issue2001

Ron





>  For C module functions that don't support keyword arguments, the old way of
>  nested brackets precisely represents how to call the function, so it should
>  stay.
>  
>  Sadly, this proposal is also the most work-intensive one since no automatic
>  conversion is possible. This being the docs, it is however possible to tackle
>  this over time on a per-module basis, so this is not necessarily a killer
>  argument.
>  
>  Georg
>  
_______________________________________________
Doc-SIG maillist  -  Doc-SIG@[...].org
http://mail.python.org/mailman/listinfo/doc-sig
Thread:
A.M. Kuchling
Georg Brandl
Ron Adam
Michael Foord
Georg Brandl
Fred Drake
Forest
A.M. Kuchling
The Blue Valkyrie
Mark Sapiro
Paul Moore

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved