Hello, I've seen repoze.who plugins use functions to validate their instantiation, and I wonder why this code is not included in the constructor?
For example, in repoze.who.plugins.form, see FormPlugin and make_plugin(). I wrote an LDAP IAuthenticator this way, but I'm now in a situation where it could better if this validation code was in the constructor: I've written a FormPlugin-based plugin (UidLDAPFormPlugin), which makes this plugin support the LDAP authenticator by adding the Distinguished Name (DN) to the identity dict. Because the only modification over the FormPlugin plugin is that the identity dict now included the 'dn' key, I'd like to re-use the code of make_plugin() to instantiate UidLDAPFormPlugin, without copying its code and add the extra parameter required by UidLDAPFormPlugin. Here you will find the code: http://bazaar.launchpad.net/~gnarea/repoze.who.plugins.ldap/trunk/annotate/15?file_id=plugins.py-20080830124739-4ppmnm62lfeh7ogf-47 Would I get side effects if I move validation code to the constructor? Thanks in advance. -- Gustavo Narea. http://gustavonarea.net/ Get rid of unethical constraints! Switch to Freedomware: http://softwareliberty.com/ _______________________________________________ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev