On 03/18/2013 10:08 AM, Roberto Polli wrote:
Hi Rich,

what do you think about using function signature to improve method
documentation?

Ex. in def setupReplica(self, args): we
  1- have to document the whole args behavior
  2- need to setup default values with args.get(name, defaultvalue)

I think that the following signature is cleaner:
1- def setupReplica(suffix, binddn, rtype=MASTER_TYPE, legacy=False, rid=None)
2- get rid of args.get with default values using eg.
suffix, rtype, legacy, binddn, rid = map(args.get 'suffix type legacy binddn
id'.split())

Moreover the **magic applied to a dict, still allows us to call
setupReplica(**args)

That sounds fine.


Let me know + Peace,
R.
---
Roberto Polli
Community Manager
Babel S.r.l. - http://www.babel.it
T: +39.06.9826.9651 M: +39.340.652.2736 F: +39.06.9826.9680
P.zza S.Benedetto da Norcia, 33 - 00040 Pomezia (Roma)

CONFIDENZIALE: Questo messaggio ed i suoi allegati sono di carattere
confidenziale per i destinatari in indirizzo.
E' vietato l'inoltro non autorizzato a destinatari diversi da quelli indicati
nel messaggio originale.
Se ricevuto per errore, l'uso del contenuto e' proibito; si prega di
comunicarlo al mittente e cancellarlo immediatamente.

--
389 users mailing list
389-users@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/389-users

Reply via email to