2010-10-20 14 views
4

dire que j'ai le code suivant:Comment commenter les fonctions Python partielles?

def func(x, y = 1, z = 2): 
    """ A comment about this function """ 
    return x + y + z 

another_func = partial(func, z = 4) 

Quelle serait la bonne façon ou Pythonic de documenter la fonction another_func?

+3

[la façon la plus correcte est démontré dans la documentation] (http://docs.python.org/library/functools. html # functools.partial) – SilentGhost

+0

user368186, est-ce que ma réponse a fonctionné pour vous? Si oui pouvez-vous le sélectionner comme correct? – kanaka

+0

Désolé, dans ma réponse différée. Journée chargée. C'est super merci. –

Répondre