[MERGE] Authentication ring implementation (read-only)

John Arbash Meinel john at arbash-meinel.com
Sun Nov 4 03:28:58 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> Martin Pool has voted tweak.

...


> 
> +class AuthenticationConfig(object):
> 
> I was surprised this is not inheriting from one of the existing
> config classes, but I don't really see a reason for it to do so.
> 
> +        super(AuthenticationConfig, self).__init__()
> 
> If it doesn't actually *have* a super method, it seems a bit strange or
> misleading to call it.  I don't know if we have a specific policy on it.
> Calling super always to get "always called first" behaviour like Java or
> C++ seems not quite right.
> 

Well, in Python, if you want to properly support multiple inheritance, you
actually have to do this.

The issue is that in more convoluted schemes, 'super()' doesn't actually call
the base class.

class A(object): pass
class B(object): pass
class C(A, B): pass

gives the hierarchy:

  object
  |   |
  A   B
   \ /
    C

The 'super()' call in C calls into A, but the super() in A actually calls into B.

So even though you don't care about object.__init__() you do care about
B.__init__().

Anyway, we don't really code around multiple inheritance. So I would tend not
to do it. But Vila *might* actually need it.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHLTx5JdeBCYSNAAMRAgpnAJ47uJl3o8mc6t22UN8x1Df9TRVKaQCfZTOB
l8FjWTX/NVVcXt2oN7e6LLE=
=3Gy6
-----END PGP SIGNATURE-----



More information about the bazaar mailing list