[ python-Bugs-1755097 ] document default values for sort parameters

SourceForge.net noreply at sourceforge.net
Mon Jul 16 22:40:17 CEST 2007


Bugs item #1755097, was opened at 2007-07-16 13:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1755097&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ilya Sandler (isandler)
Assigned to: Nobody/Anonymous (nobody)
Summary: document default values for sort parameters

Initial Comment:

sort() and sorted() accept several optional parameters.

Should default values for those optional parameters be documented? (E.g. I think both for sort and key None is the default value)

Explicitly documented defaults are needed, e.g. if you need to write a wrapper.

 def  sortWrapper( data, userKey=None)
        #do something
        data.sort(key=userKey)

(if you don't know the default values, you have to write something ugly like:

 def  sortWrapper( data, userKey=None)
        #do something
        if userKey is None:
           data.sort()
        else:
           data.sort(userKey) 


Or am I missing something?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1755097&group_id=5470


More information about the Python-bugs-list mailing list