Re: API thoughts

Barry Warsaw <[email protected]> Fri, 4 Mar 2011 11:02:28 -0500
Newsgroups gmane.comp.python.mime.devel
Organization Damn Crazy Followers of the Horn
Message-ID <[email protected]>
On Mar 04, 2011, at 08:33 AM, R. David Murray wrote:

>Ah, yes.  Well, so far my thought is that there is a global registry
>for the email package itself, but since email package access to that
>registry will be through the 'factory', there is nothing that says that
>has to be the only registry used by an application.  The existence of
>the email package global registry will allow the addition of classes
>to the "default" registry by libraries (if we dare :) and applications,
>while access through the factory means that an application is free
>to manage a completely independent registry if it prefers.  Or perhaps
>it is better to think about the default email package registry as
>just that, the *default* registry, since I think it's only specialness
>will be that it is the registry that is used by default.

I think that's a great place to start.

>But that's just my current thought, if anyone can think of a better
>design I'm all ears.
>
>I should note that one design concern I have in all this is that it so
>far looks like importing email will, under this registry design, end up
>importing pretty much *all* of the email classes (and there will be more
>of them than in the current package).  I'm so far ignoring that issue,
>treating it as a premature optimization, but if anyone has any clever
>ideas or other thoughts, let me know.

Yeah, that's a problem.  Maybe we (the Python community) should invest in good
lazy importing support for Python 3.3?  I know that this has been reinvented
several times already.

-Barry
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJNcQ0UAAoJEBJutWOnSwa/mcEP/RQnU/E0TIuVZje+DbyDxFSv
tCnN9HuOdFjpPcntMDl2+Ps9OD/W5iIIMMmoaNeHwJbH8MPB7Ac79o+ZZS3Bfy1o
DBl73opR8myzFEodgHTl4Ei24Z9Yu1yAg8istOzT4aMIK/gwIXbCpVAqFVcBcUkE
7ieuDLiz2OAroYEednmJIKt31wDBg/z+k9HxHW464EZHaalyFYH0SOPj41k2xYvA
3x5XfxEQZ1iN8LKeFmfoALrfXG6NPt/GzzigLixezoEGFyhwFIgv4JVdqrpWfKnS
0wCI9JoGaHhWg+lsc21adUf6aBY43ofwPQIO3kmkDDzxJMKrJ7Uwuicv0HjBVqyz
papNsAXM2yVtkSfAFwu78m1/5g/Dr0TmxWYoarLI1bRGOCT6/lW5/1+OK4myL3Yw
iYs5x2AEkfv8Mm5zwNePPzwXYwRPMMq76nD51X9A3+1xVzgZAQH9juWE7e/IladZ
cVhPkg7te+MJP2v9qV85nqTf5y8LH8DJVvkuPq8REagfisYNBviLN25Q6aaM9aHT
eipdBplfzXkHz+53ogBoqOP9OxCrV1oaqQoJ/TpScMXuBeo7arW3qFXN6Woymk2d
ZnsWrrhlrLukJ1qLLWl2lhs3qH6Tb+nXgv/ARd+bKtzAFapqq/EuwnQUNra41N/8
2EUNYJnkRO7E68wcPvVH
=SqDA
-----END PGP SIGNATURE-----